Class AggregatorFactory
java.lang.Object
org.opensearch.search.aggregations.AggregatorFactory
- Direct Known Subclasses:
AdjacencyMatrixAggregatorFactory
,FilterAggregatorFactory
,FiltersAggregatorFactory
,GlobalAggregatorFactory
,MultiTermsAggregationFactory
,MultiValuesSourceAggregatorFactory
,NestedAggregatorFactory
,ReverseNestedAggregatorFactory
,SamplerAggregatorFactory
,SignificantTextAggregatorFactory
,ValuesSourceAggregatorFactory
Base factory to instantiate an internal aggregator
- Opensearch.api:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AggregatorFactories
protected final String
protected final AggregatorFactory
protected final QueryShardContext
-
Constructor Summary
ConstructorsConstructorDescriptionAggregatorFactory
(String name, QueryShardContext queryShardContext, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metadata) Constructs a new aggregator factory. -
Method Summary
Modifier and TypeMethodDescriptionfinal Aggregator
create
(SearchContext searchContext, Aggregator parent, CardinalityUpperBound cardinality) Creates the aggregator.protected abstract Aggregator
createInternal
(SearchContext searchContext, Aggregator parent, CardinalityUpperBound cardinality, Map<String, Object> metadata) void
boolean
Returns the aggregation subtype for nodes usage stats.name()
protected boolean
Implementation should override this method and return true if the Aggregator created by the factory works with concurrent segment search execution model
-
Field Details
-
name
-
parent
-
factories
-
metadata
-
queryShardContext
-
-
Constructor Details
-
AggregatorFactory
public AggregatorFactory(String name, QueryShardContext queryShardContext, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder, Map<String, Object> metadata) throws IOExceptionConstructs a new aggregator factory.- Parameters:
name
- The aggregation name- Throws:
IOException
- if an error occurs creating the factory
-
-
Method Details
-
name
-
doValidate
public void doValidate() -
createInternal
protected abstract Aggregator createInternal(SearchContext searchContext, Aggregator parent, CardinalityUpperBound cardinality, Map<String, Object> metadata) throws IOException- Throws:
IOException
-
create
public final Aggregator create(SearchContext searchContext, Aggregator parent, CardinalityUpperBound cardinality) throws IOException Creates the aggregator.- Parameters:
parent
- The parent aggregator (if this is a top level factory, the parent will benull
)cardinality
- Upper bound of the number ofowningBucketOrd
s that theAggregator
created by this method will be asked to collect.- Throws:
IOException
-
getParent
-
getStatsSubtype
Returns the aggregation subtype for nodes usage stats.It should match the types registered by calling AggregationUsageService. In other words, it should be ValueSourcesType for the VST aggregations OTHER_SUBTYPE for all other aggregations.
-
supportsConcurrentSegmentSearch
protected boolean supportsConcurrentSegmentSearch()Implementation should override this method and return true if the Aggregator created by the factory works with concurrent segment search execution model -
evaluateChildFactories
public boolean evaluateChildFactories()
-