public class ParentToChildrenAggregator extends SingleBucketAggregator implements ReaderContextAware
| Modifier and Type | Class and Description |
|---|---|
static class |
ParentToChildrenAggregator.Factory |
Aggregator.BucketAggregationMode, Aggregator.Parser, Aggregator.SubAggCollectionModeBucketCollector.BucketAnalysisCollectorbigArrays, bucketAggregationMode, COLLECT_MODE, collectableSubAggregators, context, depth, estimatedBucketCount, factories, name, parent, subAggregatorsNO_OP_COLLECTOR| Constructor and Description |
|---|
ParentToChildrenAggregator(String name,
AggregatorFactories factories,
AggregationContext aggregationContext,
Aggregator parent,
String parentType,
org.apache.lucene.search.Filter childFilter,
org.apache.lucene.search.Filter parentFilter,
ValuesSource.Bytes.ParentChild valuesSource,
long maxOrd) |
| Modifier and Type | Method and Description |
|---|---|
InternalAggregation |
buildAggregation(long owningBucketOrdinal) |
InternalAggregation |
buildEmptyAggregation() |
void |
collect(int docId,
long bucketOrdinal)
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.
|
void |
setNextReader(org.apache.lucene.index.AtomicReaderContext reader) |
shouldCollectbucketAggregations, bucketDocCount, bucketEmptyAggregations, close, collectBucket, collectBucketNoCounts, collectExistingBucket, getDocCounts, incrementBucketDocCount, maxBucketOrdbucketAggregationMode, buildEmptySubAggregations, context, depth, estimatedBucketCount, gatherAnalysis, hasParentBucketAggregator, name, parent, postCollection, preCollection, runDeferredCollections, shouldDefer, subAggregator, subAggregatorswrappublic ParentToChildrenAggregator(String name, AggregatorFactories factories, AggregationContext aggregationContext, Aggregator parent, String parentType, org.apache.lucene.search.Filter childFilter, org.apache.lucene.search.Filter parentFilter, ValuesSource.Bytes.ParentChild valuesSource, long maxOrd)
public InternalAggregation buildAggregation(long owningBucketOrdinal)
buildAggregation in class Aggregatorpublic InternalAggregation buildEmptyAggregation()
buildEmptyAggregation in class Aggregatorpublic void collect(int docId,
long bucketOrdinal)
throws IOException
BucketCollectorcollect in class BucketCollectorbucketOrdinal - 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.IOExceptionpublic void setNextReader(org.apache.lucene.index.AtomicReaderContext reader)
setNextReader in interface ReaderContextAwareprotected void doPostCollection()
throws IOException
AggregatordoPostCollection in class AggregatorIOExceptionprotected void doClose()
AggregatordoClose in class AggregatorCopyright © 2009–2016. All rights reserved.