public class CardinalityAggregator extends NumericMetricsAggregator.SingleValue
NumericMetricsAggregator.MultiValue, NumericMetricsAggregator.SingleValue
Aggregator.BucketAggregationMode, Aggregator.Parser, Aggregator.SubAggCollectionMode
BucketCollector.BucketAnalysisCollector
bigArrays, bucketAggregationMode, COLLECT_MODE, collectableSubAggregators, context, depth, estimatedBucketCount, factories, name, parent, subAggregators
NO_OP_COLLECTOR
Constructor and Description |
---|
CardinalityAggregator(String name,
long estimatedBucketsCount,
ValuesSource valuesSource,
boolean rehash,
int precision,
ValueFormatter formatter,
AggregationContext context,
Aggregator parent) |
Modifier and Type | Method and Description |
---|---|
InternalAggregation |
buildAggregation(long owningBucketOrdinal) |
InternalAggregation |
buildEmptyAggregation() |
void |
collect(int doc,
long owningBucketOrdinal)
Called during the query phase, to collect & aggregate the given document.
|
protected void |
doClose()
Release instance-specific data.
|
protected void |
doPostCollection()
Can be overriden by aggregator implementation to be called back when the collection phase ends.
|
double |
metric(long owningBucketOrd) |
void |
setNextReader(org.apache.lucene.index.AtomicReaderContext reader) |
boolean |
shouldCollect() |
bucketAggregationMode, buildEmptySubAggregations, close, context, depth, estimatedBucketCount, gatherAnalysis, hasParentBucketAggregator, name, parent, postCollection, preCollection, runDeferredCollections, shouldDefer, subAggregator, subAggregators
wrap
public CardinalityAggregator(String name, long estimatedBucketsCount, ValuesSource valuesSource, boolean rehash, int precision, @Nullable ValueFormatter formatter, AggregationContext context, Aggregator parent)
public void setNextReader(org.apache.lucene.index.AtomicReaderContext reader)
public boolean shouldCollect()
shouldCollect
in class Aggregator
public void collect(int doc, long owningBucketOrdinal) throws IOException
BucketCollector
collect
in class BucketCollector
owningBucketOrdinal
- 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
protected void doPostCollection()
Aggregator
doPostCollection
in class Aggregator
public double metric(long owningBucketOrd)
metric
in class NumericMetricsAggregator.SingleValue
public InternalAggregation buildAggregation(long owningBucketOrdinal)
buildAggregation
in class Aggregator
public InternalAggregation buildEmptyAggregation()
buildEmptyAggregation
in class Aggregator
protected void doClose()
Aggregator
doClose
in class Aggregator
Copyright © 2009–2015. All rights reserved.