Module org.elasticsearch.server
Class AggregatorFactories
java.lang.Object
org.elasticsearch.search.aggregations.AggregatorFactories
An immutable collection of
AggregatorFactories.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA mutable collection ofAggregationBuilders andPipelineAggregationBuilders. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic AggregatorFactories.Builderbuilder()context()intcreateSubAggregators(Aggregator parent, CardinalityUpperBound cardinality) Create all aggregators so that they can be consumed with multiple buckets.fixParent(Aggregator fixedParent) This returns a copy ofAggregatorFactoriesmodified so that calls tocreateSubAggregators(org.elasticsearch.search.aggregations.Aggregator, org.elasticsearch.search.aggregations.CardinalityUpperBound)will ignore the provided parent aggregator and always usefixedParentprovided in to this method.static AggregatorFactories.BuilderparseAggregators(XContentParser parser) Parses the aggregation request recursively generating aggregator factories in turn.
-
Field Details
-
VALID_AGG_NAME
-
EMPTY
-
-
Method Details
-
parseAggregators
public static AggregatorFactories.Builder parseAggregators(XContentParser parser) throws IOException Parses the aggregation request recursively generating aggregator factories in turn.- Throws:
IOException
-
builder
-
context
-
createSubAggregators
public Aggregator[] createSubAggregators(Aggregator parent, CardinalityUpperBound cardinality) throws IOException Create all aggregators so that they can be consumed with multiple buckets.- Parameters:
cardinality- Upper bound of the number ofowningBucketOrds thatAggregators created by this method will be asked to collect.- Throws:
IOException
-
createTopLevelAggregators
- Throws:
IOException
-
countAggregators
public int countAggregators()- Returns:
- the number of sub-aggregator factories
-
fixParent
This returns a copy ofAggregatorFactoriesmodified so that calls tocreateSubAggregators(org.elasticsearch.search.aggregations.Aggregator, org.elasticsearch.search.aggregations.CardinalityUpperBound)will ignore the provided parent aggregator and always usefixedParentprovided in to this method.AdaptingAggregatoruses this to make sure that sub-aggregators get theAdaptingAggregatoraggregator itself as the parent.
-