Class TermsAggregator
java.lang.Object
org.elasticsearch.search.aggregations.BucketCollector
org.elasticsearch.search.aggregations.Aggregator
org.elasticsearch.search.aggregations.AggregatorBase
org.elasticsearch.search.aggregations.bucket.BucketsAggregator
org.elasticsearch.search.aggregations.bucket.DeferableBucketAggregator
org.elasticsearch.search.aggregations.bucket.terms.TermsAggregator
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,org.apache.lucene.search.Collector,Releasable
- Direct Known Subclasses:
GlobalOrdinalsStringTermsAggregator,MapStringTermsAggregator,NumericTermsAggregator
public abstract class TermsAggregator extends DeferableBucketAggregator
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTermsAggregator.BucketCountThresholdsNested classes/interfaces inherited from class org.elasticsearch.search.aggregations.bucket.BucketsAggregator
BucketsAggregator.BucketBuilderForFixedCount<B>, BucketsAggregator.BucketBuilderForVariable<B>, BucketsAggregator.ResultBuilderForVariable<B>, BucketsAggregator.SingleBucketResultBuilderNested classes/interfaces inherited from class org.elasticsearch.search.aggregations.Aggregator
Aggregator.BucketComparator, Aggregator.Parser, Aggregator.SubAggCollectionMode -
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<Aggregator>aggsUsedForSortingprotected TermsAggregator.BucketCountThresholdsbucketCountThresholdsprotected Aggregator.SubAggCollectionModecollectModeprotected DocValueFormatformatprotected BucketOrderorderprotected java.util.Comparator<InternalTerms.Bucket<?>>partiallyBuiltBucketComparatorFields inherited from class org.elasticsearch.search.aggregations.bucket.BucketsAggregator
docCountProviderFields inherited from class org.elasticsearch.search.aggregations.AggregatorBase
collectableSubAggregators, DEFAULT_WEIGHT, name, parent, subAggregatorsFields inherited from class org.elasticsearch.search.aggregations.BucketCollector
NO_OP_COLLECTOR -
Constructor Summary
Constructors Constructor Description TermsAggregator(java.lang.String name, AggregatorFactories factories, AggregationContext context, Aggregator parent, TermsAggregator.BucketCountThresholds bucketCountThresholds, BucketOrder order, DocValueFormat format, Aggregator.SubAggCollectionMode collectMode, java.util.Map<java.lang.String,java.lang.Object> metadata) -
Method Summary
Modifier and Type Method Description static java.util.Set<Aggregator>aggsUsedForSorting(Aggregator root, BucketOrder order)Walks through bucket order and extracts all aggregations used for sortingstatic booleandescendsFromNestedAggregator(Aggregator parent)protected booleanshouldDefer(Aggregator aggregator)This method should be overridden by subclasses that want to defer calculation of a child aggregation until a first pass is complete and a set of buckets has been pruned.Methods inherited from class org.elasticsearch.search.aggregations.bucket.DeferableBucketAggregator
buildDeferringCollector, collectDebugInfo, deferringCollector, doPreCollection, prepareSubAggsMethods inherited from class org.elasticsearch.search.aggregations.bucket.BucketsAggregator
bucketComparator, bucketDocCount, buildAggregationsForFixedBucketCount, buildAggregationsForSingleBucket, buildAggregationsForVariableBuckets, buildSubAggsForAllBuckets, buildSubAggsForBuckets, buildSubAggsForBuckets, close, collectBucket, collectExistingBucket, descendsFromGlobalAggregator, getDocCounts, grow, incrementBucketDocCount, maxBucketOrd, preGetSubLeafCollectors, resolveSortPath, rewriteBucketsMethods inherited from class org.elasticsearch.search.aggregations.AggregatorBase
addRequestCircuitBreakerBytes, bigArrays, buildEmptySubAggregations, doClose, doPostCollection, getLeafCollector, getLeafCollector, metadata, name, parent, pointReaderIfAvailable, postCollection, preCollection, scoreMode, searcher, subAggregator, subAggregators, topLevelQuery, toStringMethods inherited from class org.elasticsearch.search.aggregations.Aggregator
buildAggregations, buildEmptyAggregation, buildTopLevel, resolveSortPathOnValidAggMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
format
-
bucketCountThresholds
-
order
-
partiallyBuiltBucketComparator
-
aggsUsedForSorting
-
collectMode
-
-
Constructor Details
-
TermsAggregator
public TermsAggregator(java.lang.String name, AggregatorFactories factories, AggregationContext context, Aggregator parent, TermsAggregator.BucketCountThresholds bucketCountThresholds, BucketOrder order, DocValueFormat format, Aggregator.SubAggCollectionMode collectMode, java.util.Map<java.lang.String,java.lang.Object> metadata) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Details
-
aggsUsedForSorting
Walks through bucket order and extracts all aggregations used for sorting -
descendsFromNestedAggregator
-
shouldDefer
Description copied from class:DeferableBucketAggregatorThis method should be overridden by subclasses that want to defer calculation of a child aggregation until a first pass is complete and a set of buckets has been pruned.- Overrides:
shouldDeferin classDeferableBucketAggregator- Parameters:
aggregator- the child aggregator- Returns:
- true if the aggregator should be deferred until a first pass at collection has completed
-