Class AggregatorFactories
java.lang.Object
org.elasticsearch.search.aggregations.AggregatorFactories
An immutable collection of
AggregatorFactories.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic 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(org.elasticsearch.common.xcontent.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(org.elasticsearch.common.xcontent.XContentParser parser) throws IOExceptionParses the aggregation request recursively generating aggregator factories in turn.- Throws:
IOException
-
builder
-
context
-
createSubAggregators
public Aggregator[] createSubAggregators(Aggregator parent, CardinalityUpperBound cardinality) throws IOExceptionCreate 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.
-