public class SamplerAggregator extends SingleBucketAggregator
Modifier and Type | Class and Description |
---|---|
static class |
SamplerAggregator.DiversifiedFactory |
static class |
SamplerAggregator.ExecutionMode |
static class |
SamplerAggregator.Factory |
Aggregator.Parser, Aggregator.SubAggCollectionMode
Modifier and Type | Field and Description |
---|---|
protected BestDocsDeferringCollector |
bdd |
protected int |
shardSize |
collectableSubAggregators, context, name, parent, subAggregators
NO_OP_COLLECTOR
Constructor and Description |
---|
SamplerAggregator(String name,
int shardSize,
AggregatorFactories factories,
AggregationContext aggregationContext,
Aggregator parent,
List<PipelineAggregator> pipelineAggregators,
Map<String,Object> metaData) |
Modifier and Type | Method and Description |
---|---|
InternalAggregation |
buildAggregation(long owningBucketOrdinal)
Build an aggregation for data that has been collected into
bucket . |
InternalAggregation |
buildEmptyAggregation()
Build an empty aggregation.
|
protected void |
doClose()
Release instance-specific data.
|
DeferringBucketCollector |
getDeferringCollector() |
protected 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.
|
protected boolean |
shouldDefer(Aggregator aggregator)
This method should be overidden by subclasses that want to defer calculation
of a child aggregation until a first pass is complete and a set of buckets has
been pruned.
|
bucketAggregations, bucketDocCount, bucketEmptyAggregations, close, collectBucket, collectExistingBucket, getDocCounts, grow, incrementBucketDocCount, maxBucketOrd
buildEmptySubAggregations, context, doPostCollection, doPreCollection, getLeafCollector, metaData, name, parent, pipelineAggregators, postCollection, preCollection, runDeferredCollections, subAggregator, subAggregators, toString
descendsFromBucketAggregator
wrap
protected final int shardSize
protected BestDocsDeferringCollector bdd
public SamplerAggregator(String name, int shardSize, AggregatorFactories factories, AggregationContext aggregationContext, Aggregator parent, List<PipelineAggregator> pipelineAggregators, Map<String,Object> metaData) throws IOException
IOException
public boolean needsScores()
AggregatorBase
needsScores
in interface org.apache.lucene.search.Collector
needsScores
in class AggregatorBase
public DeferringBucketCollector getDeferringCollector()
getDeferringCollector
in class AggregatorBase
protected boolean shouldDefer(Aggregator aggregator)
AggregatorBase
AggregatorBase.runDeferredCollections(long...)
for the selected set of buckets that survive the pruning.shouldDefer
in class AggregatorBase
aggregator
- the child aggregatorpublic InternalAggregation buildAggregation(long owningBucketOrdinal) throws IOException
Aggregator
bucket
.buildAggregation
in class Aggregator
IOException
public InternalAggregation buildEmptyAggregation()
Aggregator
buildEmptyAggregation
in class Aggregator
protected LeafBucketCollector getLeafCollector(org.apache.lucene.index.LeafReaderContext ctx, LeafBucketCollector sub) throws IOException
AggregatorBase
LeafBucketCollector
for the given ctx, which should
delegate to the given collector.getLeafCollector
in class AggregatorBase
IOException
protected void doClose()
AggregatorBase
doClose
in class AggregatorBase
Copyright © 2009–2016. All rights reserved.