Class AggregatorFactories
java.lang.Object
org.elasticsearch.search.aggregations.AggregatorFactories
An immutable collection of
AggregatorFactories
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A mutable collection ofAggregationBuilder
s andPipelineAggregationBuilder
s. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic AggregatorFactories.Builder
builder()
context()
int
createSubAggregators(Aggregator parent, CardinalityUpperBound cardinality)
Create all aggregators so that they can be consumed with multiple buckets.fixParent(Aggregator fixedParent)
This returns a copy ofAggregatorFactories
modified so that calls tocreateSubAggregators(org.elasticsearch.search.aggregations.Aggregator, org.elasticsearch.search.aggregations.CardinalityUpperBound)
will ignore the provided parent aggregator and always usefixedParent
provided in to this method.static AggregatorFactories.Builder
parseAggregators(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 ofowningBucketOrd
s thatAggregator
s 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 ofAggregatorFactories
modified so that calls tocreateSubAggregators(org.elasticsearch.search.aggregations.Aggregator, org.elasticsearch.search.aggregations.CardinalityUpperBound)
will ignore the provided parent aggregator and always usefixedParent
provided in to this method.AdaptingAggregator
uses this to make sure that sub-aggregators get theAdaptingAggregator
aggregator itself as the parent.
-