public class GlobalOrdinalsStringTermsAggregator extends TermsAggregator
| Modifier and Type | Class and Description |
|---|---|
static class |
GlobalOrdinalsStringTermsAggregator.LowCardinality
Variant of
GlobalOrdinalsStringTermsAggregator that resolves global ordinals post segment collection
instead of on the fly for each match.This is beneficial for low cardinality fields, because it can reduce
the amount of look-ups significantly. |
static class |
GlobalOrdinalsStringTermsAggregator.WithHash
Variant of
GlobalOrdinalsStringTermsAggregator that rebases hashes in order to make them dense. |
TermsAggregator.BucketCountThresholdsAggregator.BucketAggregationMode, Aggregator.Parser, Aggregator.SubAggCollectionModeBucketCollector.BucketAnalysisCollector| Modifier and Type | Field and Description |
|---|---|
protected org.apache.lucene.util.LongBitSet |
acceptedGlobalOrdinals |
protected org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.Collector |
collector |
protected org.apache.lucene.index.RandomAccessOrds |
globalOrds |
protected IncludeExclude |
includeExclude |
protected boolean |
showTermDocCountError |
protected ValuesSource.Bytes.WithOrdinals.FieldData |
valuesSource |
aggsUsedForSorting, bucketCountThresholds, order, subAggCollectModebigArrays, bucketAggregationMode, COLLECT_MODE, collectableSubAggregators, context, depth, estimatedBucketCount, factories, name, parent, subAggregatorsNO_OP_COLLECTOR| Constructor and Description |
|---|
GlobalOrdinalsStringTermsAggregator(String name,
AggregatorFactories factories,
ValuesSource.Bytes.WithOrdinals.FieldData valuesSource,
long estimatedBucketCount,
long maxOrd,
Terms.Order order,
TermsAggregator.BucketCountThresholds bucketCountThresholds,
IncludeExclude includeExclude,
AggregationContext aggregationContext,
Aggregator parent,
Aggregator.SubAggCollectionMode collectionMode,
boolean showTermDocCountError) |
| 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 static void |
copy(org.apache.lucene.util.BytesRef from,
org.apache.lucene.util.BytesRef to) |
protected long |
getBucketOrd(long termOrd) |
protected org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.Collector |
newCollector(org.apache.lucene.index.RandomAccessOrds ords) |
void |
setNextReader(org.apache.lucene.index.AtomicReaderContext reader) |
boolean |
shouldCollect() |
shouldDeferbucketAggregations, bucketDocCount, bucketEmptyAggregations, close, collectBucket, collectBucketNoCounts, collectExistingBucket, getDocCounts, incrementBucketDocCount, maxBucketOrdbucketAggregationMode, buildEmptySubAggregations, context, depth, doClose, doPostCollection, estimatedBucketCount, gatherAnalysis, hasParentBucketAggregator, name, parent, postCollection, preCollection, runDeferredCollections, subAggregator, subAggregatorswrapprotected final ValuesSource.Bytes.WithOrdinals.FieldData valuesSource
protected final IncludeExclude includeExclude
protected org.apache.lucene.index.RandomAccessOrds globalOrds
protected org.apache.lucene.util.LongBitSet acceptedGlobalOrdinals
protected org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.Collector collector
protected final boolean showTermDocCountError
public GlobalOrdinalsStringTermsAggregator(String name, AggregatorFactories factories, ValuesSource.Bytes.WithOrdinals.FieldData valuesSource, long estimatedBucketCount, long maxOrd, Terms.Order order, TermsAggregator.BucketCountThresholds bucketCountThresholds, IncludeExclude includeExclude, AggregationContext aggregationContext, Aggregator parent, Aggregator.SubAggCollectionMode collectionMode, boolean showTermDocCountError)
protected long getBucketOrd(long termOrd)
public boolean shouldCollect()
protected org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.Collector newCollector(org.apache.lucene.index.RandomAccessOrds ords)
public void setNextReader(org.apache.lucene.index.AtomicReaderContext reader)
public void collect(int doc,
long owningBucketOrdinal)
throws IOException
BucketCollectorcollect in class BucketCollectorowningBucketOrdinal - 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.IOExceptionprotected static void copy(org.apache.lucene.util.BytesRef from,
org.apache.lucene.util.BytesRef to)
public InternalAggregation buildAggregation(long owningBucketOrdinal)
buildAggregation in class Aggregatorpublic InternalAggregation buildEmptyAggregation()
buildEmptyAggregation in class AggregatorCopyright © 2009–2016. All rights reserved.