public abstract class BucketCollector extends Object implements ReaderContextAware
Modifier and Type | Class and Description |
---|---|
static interface |
BucketCollector.BucketAnalysisCollector
Used to gather a summary from a bucket
|
Modifier and Type | Field and Description |
---|---|
static BucketCollector |
NO_OP_COLLECTOR |
Constructor and Description |
---|
BucketCollector() |
Modifier and Type | Method and Description |
---|---|
abstract void |
collect(int docId,
long bucketOrdinal)
Called during the query phase, to collect & aggregate the given document.
|
abstract void |
gatherAnalysis(BucketCollector.BucketAnalysisCollector analysisCollector,
long bucketOrdinal)
Called post-collection to gather the results from surviving buckets.
|
abstract void |
postCollection()
Post collection callback.
|
static BucketCollector |
wrap(Iterable<? extends BucketCollector> collectorList)
Wrap the given collectors into a single instance.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setNextReader
public static final BucketCollector NO_OP_COLLECTOR
public static BucketCollector wrap(Iterable<? extends BucketCollector> collectorList)
public abstract void collect(int docId, long bucketOrdinal) throws IOException
doc
- The document to be collected/aggregatedbucketOrdinal
- The ordinal of the bucket this aggregator belongs to, assuming this aggregator is not a top level aggregator.
Typically, aggregators with #bucketAggregationMode
set to Aggregator.BucketAggregationMode.MULTI_BUCKETS
will heavily depend on this ordinal. Other aggregators may or may not use it and can see this ordinal as just
an extra information for the aggregation context. For top level aggregators, the ordinal will always be
equal to 0.IOException
public abstract void postCollection() throws IOException
IOException
public abstract void gatherAnalysis(BucketCollector.BucketAnalysisCollector analysisCollector, long bucketOrdinal)
analysisCollector
- bucketOrdinal
- Copyright © 2009–2015. All rights reserved.