Class MergingBucketsDeferringCollector
java.lang.Object
org.elasticsearch.search.aggregations.BucketCollector
org.elasticsearch.search.aggregations.bucket.DeferringBucketCollector
org.elasticsearch.search.aggregations.bucket.BestBucketsDeferringCollector
org.elasticsearch.search.aggregations.bucket.MergingBucketsDeferringCollector
- All Implemented Interfaces:
org.apache.lucene.search.Collector
public class MergingBucketsDeferringCollector extends BestBucketsDeferringCollector
A specialization of
BestBucketsDeferringCollector
that collects all
matches and then is able to replay a given subset of buckets. Exposes
mergeBuckets, which can be invoked by the aggregator when increasing the
rounding interval.-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.bucket.DeferringBucketCollector
DeferringBucketCollector.WrappedAggregator
-
Field Summary
Fields inherited from class org.elasticsearch.search.aggregations.bucket.BestBucketsDeferringCollector
bucketsBuilder, collector, context, docDeltasBuilder, entries, finished, isGlobal, maxBucket, searchContext, selectedBuckets
-
Constructor Summary
Constructors Constructor Description MergingBucketsDeferringCollector(SearchContext context, boolean isGlobal)
-
Method Summary
Modifier and Type Method Description void
mergeBuckets(long[] mergeMap)
Merges/prunes the existing bucket ordinals and docDeltas according to the provided mergeMap.Methods inherited from class org.elasticsearch.search.aggregations.bucket.BestBucketsDeferringCollector
getLeafCollector, postCollection, preCollection, prepareSelectedBuckets, scoreMode, setDeferredCollector, wrap
Methods inherited from class org.elasticsearch.search.aggregations.bucket.DeferringBucketCollector
replay
-
Constructor Details
-
Method Details
-
mergeBuckets
public void mergeBuckets(long[] mergeMap)Merges/prunes the existing bucket ordinals and docDeltas according to the provided mergeMap. The mergeMap is an array where the index position represents the current bucket ordinal, and the value at that position represents the ordinal the bucket should be merged with. If the value is set to -1 it is removed entirely. For example, if the mergeMap [1,1,3,-1,3] is provided: - Buckets `0` and `1` will be merged to bucket ordinal `1` - Bucket `2` and `4` will be merged to ordinal `3` - Bucket `3` will be removed entirely This process rebuilds the ordinals and docDeltas according to the mergeMap, so it should not be called unless there are actually changes to be made, to avoid unnecessary work.
-