Class AggregatorFactories
java.lang.Object
org.elasticsearch.search.aggregations.AggregatorFactories
public class AggregatorFactories
extends java.lang.Object
An immutable collection of
AggregatorFactories
.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AggregatorFactories.Builder
A mutable collection ofAggregationBuilder
s andPipelineAggregationBuilder
s. -
Field Summary
Fields Modifier and Type Field Description static AggregatorFactories
EMPTY
static java.util.regex.Pattern
VALID_AGG_NAME
-
Method Summary
Modifier and Type Method Description static AggregatorFactories.Builder
builder()
AggregationContext
context()
int
countAggregators()
Aggregator[]
createSubAggregators(Aggregator parent, CardinalityUpperBound cardinality)
Create all aggregators so that they can be consumed with multiple buckets.Aggregator[]
createTopLevelAggregators()
AggregatorFactories
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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
VALID_AGG_NAME
public static final java.util.regex.Pattern VALID_AGG_NAME -
EMPTY
-
-
Method Details
-
parseAggregators
public static AggregatorFactories.Builder parseAggregators(org.elasticsearch.common.xcontent.XContentParser parser) throws java.io.IOExceptionParses the aggregation request recursively generating aggregator factories in turn.- Throws:
java.io.IOException
-
builder
-
context
-
createSubAggregators
public Aggregator[] createSubAggregators(Aggregator parent, CardinalityUpperBound cardinality) throws java.io.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:
java.io.IOException
-
createTopLevelAggregators
- Throws:
java.io.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.
-