Module org.elasticsearch.server
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
,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
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.BucketCollector
BucketCollector.BucketCollectorWrapper
-
Field Summary
Fields inherited from class org.elasticsearch.search.aggregations.BucketCollector
NO_OP_BUCKET_COLLECTOR, NO_OP_COLLECTOR
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected org.apache.lucene.search.TopDocsCollector<? extends org.apache.lucene.search.ScoreDoc>
createTopDocsCollector
(int size) int
getDocCount
(long parentBucket) protected long
void
Post-collection callback.void
Pre collection callback.void
prepareSelectedBuckets
(long... selectedBuckets) Replay the deferred hits on the selected buckets.org.apache.lucene.search.ScoreMode
Indicates what features are required from the scorer.void
setDeferredCollector
(Iterable<BucketCollector> deferredCollectors) Set the deferred collectors.Methods inherited from class org.elasticsearch.search.aggregations.bucket.DeferringBucketCollector
wrap
Methods inherited from class org.elasticsearch.search.aggregations.BucketCollector
asCollector
-
Method Details
-
scoreMode
public org.apache.lucene.search.ScoreMode scoreMode()Description copied from class:BucketCollector
Indicates what features are required from the scorer.- Specified by:
scoreMode
in classBucketCollector
-
setDeferredCollector
Set the deferred collectors.- Specified by:
setDeferredCollector
in classDeferringBucketCollector
-
getLeafCollector
- Specified by:
getLeafCollector
in 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:BucketCollector
Pre collection callback.- Specified by:
preCollection
in classBucketCollector
- Throws:
IOException
-
postCollection
Description copied from class:BucketCollector
Post-collection callback.- Specified by:
postCollection
in classBucketCollector
- Throws:
IOException
-
prepareSelectedBuckets
Description copied from class:DeferringBucketCollector
Replay the deferred hits on the selected buckets.- Specified by:
prepareSelectedBuckets
in classDeferringBucketCollector
- Throws:
IOException
-
getDocCount
public int getDocCount(long parentBucket) -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceReleasable
- Throws:
ElasticsearchException
-