public class TopHitsAggregator extends MetricsAggregator
Aggregator.Parser, Aggregator.SubAggCollectionMode
collectableSubAggregators, context, DEFAULT_WEIGHT, name, parent, subAggregators
NO_OP_COLLECTOR
Constructor and Description |
---|
TopHitsAggregator(FetchPhase fetchPhase,
SubSearchContext subSearchContext,
java.lang.String name,
SearchContext context,
Aggregator parent,
java.util.List<PipelineAggregator> pipelineAggregators,
java.util.Map<java.lang.String,java.lang.Object> metaData) |
Modifier and Type | Method and Description |
---|---|
InternalAggregation |
buildAggregation(long owningBucketOrdinal)
Build an aggregation for data that has been collected into
bucket . |
InternalTopHits |
buildEmptyAggregation()
Build an empty aggregation.
|
protected void |
doClose()
Release instance-specific data.
|
LeafBucketCollector |
getLeafCollector(org.apache.lucene.index.LeafReaderContext ctx,
LeafBucketCollector sub)
Get a
LeafBucketCollector for the given ctx, which should
delegate to the given collector. |
boolean |
needsScores()
Most aggregators don't need scores, make sure to extend this method if
your aggregator needs them.
|
buildEmptySubAggregations, close, context, doPostCollection, doPreCollection, getDeferringCollector, getLeafCollector, metaData, name, parent, pipelineAggregators, postCollection, preCollection, runDeferredCollections, shouldDefer, subAggregator, subAggregators, toString
descendsFromBucketAggregator
wrap
public TopHitsAggregator(FetchPhase fetchPhase, SubSearchContext subSearchContext, java.lang.String name, SearchContext context, Aggregator parent, java.util.List<PipelineAggregator> pipelineAggregators, java.util.Map<java.lang.String,java.lang.Object> metaData) throws java.io.IOException
java.io.IOException
public boolean needsScores()
AggregatorBase
needsScores
in interface org.apache.lucene.search.Collector
needsScores
in class AggregatorBase
public LeafBucketCollector getLeafCollector(org.apache.lucene.index.LeafReaderContext ctx, LeafBucketCollector sub) throws java.io.IOException
AggregatorBase
LeafBucketCollector
for the given ctx, which should
delegate to the given collector.getLeafCollector
in class AggregatorBase
java.io.IOException
public InternalAggregation buildAggregation(long owningBucketOrdinal)
Aggregator
bucket
.buildAggregation
in class Aggregator
public InternalTopHits buildEmptyAggregation()
Aggregator
buildEmptyAggregation
in class Aggregator
protected void doClose()
AggregatorBase
doClose
in class AggregatorBase