Class BestDocsDeferringCollector
java.lang.Object
org.elasticsearch.search.aggregations.BucketCollector
org.elasticsearch.search.aggregations.bucket.DeferringBucketCollector
org.elasticsearch.search.aggregations.bucket.sampler.BestDocsDeferringCollector
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.lucene.search.Collector,org.elasticsearch.core.Releasable
public class BestDocsDeferringCollector
extends DeferringBucketCollector
implements org.elasticsearch.core.Releasable
A specialization of
DeferringBucketCollector that collects all
matches and then replays only the top scoring documents to child
aggregations. The method
createTopDocsCollector(int) is designed to
be overridden and allows subclasses to choose a custom collector
implementation for determining the top N matches.-
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.BucketCollector
NO_OP_COLLECTOR -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected org.apache.lucene.search.TopDocsCollector<? extends org.apache.lucene.search.ScoreDoc>createTopDocsCollector(int size)intgetDocCount(long parentBucket)getLeafCollector(org.apache.lucene.index.LeafReaderContext ctx)protected longvoidPost-collection callback.voidPre collection callback.voidprepareSelectedBuckets(long... selectedBuckets)Replay the deferred hits on the selected buckets.org.apache.lucene.search.ScoreModevoidsetDeferredCollector(Iterable<BucketCollector> deferredCollectors)Set the deferred collectors.Methods inherited from class org.elasticsearch.search.aggregations.bucket.DeferringBucketCollector
wrap
-
Method Details
-
scoreMode
public org.apache.lucene.search.ScoreMode scoreMode()- Specified by:
scoreModein interfaceorg.apache.lucene.search.Collector
-
setDeferredCollector
Set the deferred collectors.- Specified by:
setDeferredCollectorin classDeferringBucketCollector
-
getLeafCollector
public LeafBucketCollector getLeafCollector(org.apache.lucene.index.LeafReaderContext ctx) throws IOException- Specified by:
getLeafCollectorin interfaceorg.apache.lucene.search.Collector- Specified by:
getLeafCollectorin classBucketCollector- Throws:
IOException
-
createTopDocsCollector
protected org.apache.lucene.search.TopDocsCollector<? extends org.apache.lucene.search.ScoreDoc> createTopDocsCollector(int size) throws IOException- Throws:
IOException
-
getPriorityQueueSlotSize
protected long getPriorityQueueSlotSize() -
preCollection
Description copied from class:BucketCollectorPre collection callback.- Specified by:
preCollectionin classBucketCollector- Throws:
IOException
-
postCollection
Description copied from class:BucketCollectorPost-collection callback.- Specified by:
postCollectionin classBucketCollector- Throws:
IOException
-
prepareSelectedBuckets
Description copied from class:DeferringBucketCollectorReplay the deferred hits on the selected buckets.- Specified by:
prepareSelectedBucketsin classDeferringBucketCollector- Throws:
IOException
-
getDocCount
public int getDocCount(long parentBucket) -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.elasticsearch.core.Releasable- Throws:
ElasticsearchException
-