public class BestDocsDeferringCollector extends DeferringBucketCollector implements Releasable
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.DeferringBucketCollector.WrappedAggregatorNO_OP_COLLECTOR| Constructor and Description |
|---|
BestDocsDeferringCollector(int shardSize,
BigArrays bigArrays)
Sole constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected org.apache.lucene.search.TopDocsCollector<? extends org.apache.lucene.search.ScoreDoc> |
createTopDocsCollector(int size) |
int |
getDocCount(long parentBucket) |
LeafBucketCollector |
getLeafCollector(org.apache.lucene.index.LeafReaderContext ctx) |
boolean |
needsScores() |
void |
postCollection()
Post-collection callback.
|
void |
preCollection()
Pre collection callback.
|
void |
prepareSelectedBuckets(long... selectedBuckets) |
void |
setDeferredCollector(Iterable<BucketCollector> deferredCollectors)
Set the deferred collectors.
|
replay, wrapwrappublic BestDocsDeferringCollector(int shardSize,
BigArrays bigArrays)
shardSize - The number of top-scoring docs to collect for each bucketpublic boolean needsScores()
needsScores in interface org.apache.lucene.search.Collectorpublic void setDeferredCollector(Iterable<BucketCollector> deferredCollectors)
setDeferredCollector in class DeferringBucketCollectorpublic LeafBucketCollector getLeafCollector(org.apache.lucene.index.LeafReaderContext ctx) throws IOException
getLeafCollector in interface org.apache.lucene.search.CollectorgetLeafCollector in class BucketCollectorIOExceptionprotected org.apache.lucene.search.TopDocsCollector<? extends org.apache.lucene.search.ScoreDoc> createTopDocsCollector(int size)
throws IOException
IOExceptionpublic void preCollection()
throws IOException
BucketCollectorpreCollection in class BucketCollectorIOExceptionpublic void postCollection()
throws IOException
BucketCollectorpostCollection in class BucketCollectorIOExceptionpublic void prepareSelectedBuckets(long... selectedBuckets)
throws IOException
prepareSelectedBuckets in class DeferringBucketCollectorIOExceptionpublic int getDocCount(long parentBucket)
public void close()
throws ElasticsearchException
close in interface AutoCloseableclose in interface ReleasableElasticsearchExceptionCopyright © 2009–2017. All rights reserved.