Class AbstractRareTermsAggregator<T extends ValuesSource,U extends IncludeExclude.Filter,V>
- 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.AbstractRareTermsAggregator<T,U,V>
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,org.apache.lucene.search.Collector
,Releasable
- Direct Known Subclasses:
LongRareTermsAggregator
,StringRareTermsAggregator
public abstract class AbstractRareTermsAggregator<T extends ValuesSource,U extends IncludeExclude.Filter,V> extends DeferableBucketAggregator
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.Aggregator
Aggregator.Parser, Aggregator.SubAggCollectionMode
-
-
Field Summary
Fields Modifier and Type Field Description protected DocValueFormat
format
protected U
includeExclude
protected long
maxDocCount
protected double
precision
protected T
valuesSource
-
Fields inherited from class org.elasticsearch.search.aggregations.AggregatorBase
collectableSubAggregators, context, DEFAULT_WEIGHT, name, parent, subAggregators
-
Fields inherited from class org.elasticsearch.search.aggregations.BucketCollector
NO_OP_COLLECTOR
-
-
Method Summary
Modifier and Type Method Description protected void
doCollect(V val, int docId)
DeferringBucketCollector
getDeferringCollector()
protected boolean
shouldDefer(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
descendsFromGlobalAggregator, doPreCollection, runDeferredCollections
-
Methods inherited from class org.elasticsearch.search.aggregations.bucket.BucketsAggregator
bucketAggregations, bucketDocCount, bucketEmptyAggregations, close, collectBucket, collectExistingBucket, consumeBucketsAndMaybeBreak, getDocCounts, grow, incrementBucketDocCount, maxBucketOrd, mergeBuckets
-
Methods inherited from class org.elasticsearch.search.aggregations.AggregatorBase
addRequestCircuitBreakerBytes, buildEmptySubAggregations, context, doClose, doPostCollection, getLeafCollector, getLeafCollector, metaData, name, parent, pipelineAggregators, postCollection, preCollection, preGetSubLeafCollectors, scoreMode, subAggregator, subAggregators, toString
-
Methods inherited from class org.elasticsearch.search.aggregations.Aggregator
buildAggregation, buildEmptyAggregation, descendsFromBucketAggregator
-
-
-
-
Field Detail
-
maxDocCount
protected final long maxDocCount
-
precision
protected final double precision
-
format
protected final DocValueFormat format
-
valuesSource
protected final T extends ValuesSource valuesSource
-
includeExclude
protected final U extends IncludeExclude.Filter includeExclude
-
-
Method Detail
-
shouldDefer
protected boolean shouldDefer(Aggregator aggregator)
Description copied from class:DeferableBucketAggregator
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. Deferring collection will require the recording of all doc/bucketIds from the first pass and then the sub class should callDeferableBucketAggregator.runDeferredCollections(long...)
for the selected set of buckets that survive the pruning.- Overrides:
shouldDefer
in classDeferableBucketAggregator
- Parameters:
aggregator
- the child aggregator- Returns:
- true if the aggregator should be deferred until a first pass at collection has completed
-
getDeferringCollector
public DeferringBucketCollector getDeferringCollector()
- Overrides:
getDeferringCollector
in classDeferableBucketAggregator
-
doCollect
protected void doCollect(V val, int docId) throws java.io.IOException
- Throws:
java.io.IOException
-
-