Class ParentJoinAggregator

java.lang.Object
org.elasticsearch.search.aggregations.BucketCollector
org.elasticsearch.search.aggregations.Aggregator
org.elasticsearch.search.aggregations.AggregatorBase
org.elasticsearch.search.aggregations.bucket.BucketsAggregator
org.elasticsearch.join.aggregations.ParentJoinAggregator
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable, org.apache.lucene.search.Collector, org.elasticsearch.common.lease.Releasable, org.elasticsearch.search.aggregations.bucket.SingleBucketAggregator
Direct Known Subclasses:
ChildrenToParentAggregator, ParentToChildrenAggregator

public abstract class ParentJoinAggregator
extends org.elasticsearch.search.aggregations.bucket.BucketsAggregator
implements org.elasticsearch.search.aggregations.bucket.SingleBucketAggregator
An aggregator that joins documents based on global ordinals. Global ordinals that match the main query and the inFilter query are replayed with documents matching the outFilter query.
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    protected static interface  ParentJoinAggregator.CollectionStrategy
    Strategy for collecting the global ordinals of the join field in for all docs that match the ParentJoinAggregator#inFilter and then checking if which of the docs in the ParentJoinAggregator#outFilter also have the ordinal.
    protected class  ParentJoinAggregator.DenseCollectionStrategy
    Uses a dense, bit per ordinal representation of the join field in the docs that match ParentJoinAggregator#inFilter.
    protected class  ParentJoinAggregator.SparseCollectionStrategy
    Uses a hashed representation of whether of the join field in the docs that match ParentJoinAggregator#inFilter.

    Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.bucket.BucketsAggregator

    org.elasticsearch.search.aggregations.bucket.BucketsAggregator.BucketBuilderForFixedCount<B extends java.lang.Object>, org.elasticsearch.search.aggregations.bucket.BucketsAggregator.BucketBuilderForVariable<B extends java.lang.Object>, org.elasticsearch.search.aggregations.bucket.BucketsAggregator.ResultBuilderForVariable<B extends java.lang.Object>, org.elasticsearch.search.aggregations.bucket.BucketsAggregator.SingleBucketResultBuilder

    Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.Aggregator

    org.elasticsearch.search.aggregations.Aggregator.BucketComparator, org.elasticsearch.search.aggregations.Aggregator.Parser, org.elasticsearch.search.aggregations.Aggregator.SubAggCollectionMode
  • Field Summary

    Fields inherited from class org.elasticsearch.search.aggregations.bucket.BucketsAggregator

    docCountProvider

    Fields inherited from class org.elasticsearch.search.aggregations.AggregatorBase

    collectableSubAggregators, DEFAULT_WEIGHT, name, parent, subAggregators

    Fields inherited from class org.elasticsearch.search.aggregations.BucketCollector

    NO_OP_COLLECTOR
  • Constructor Summary

    Constructors
    Constructor Description
    ParentJoinAggregator​(java.lang.String name, org.elasticsearch.search.aggregations.AggregatorFactories factories, org.elasticsearch.search.aggregations.support.AggregationContext context, org.elasticsearch.search.aggregations.Aggregator parent, org.apache.lucene.search.Query inFilter, org.apache.lucene.search.Query outFilter, org.elasticsearch.search.aggregations.support.ValuesSource.Bytes.WithOrdinals valuesSource, long maxOrd, org.elasticsearch.search.aggregations.CardinalityUpperBound cardinality, java.util.Map<java.lang.String,​java.lang.Object> metadata)  
  • Method Summary

    Modifier and Type Method Description
    protected void doClose()  
    org.elasticsearch.search.aggregations.LeafBucketCollector getLeafCollector​(org.apache.lucene.index.LeafReaderContext ctx, org.elasticsearch.search.aggregations.LeafBucketCollector sub)  
    void postCollection()  
    protected void prepareSubAggs​(long[] ordsToCollect)  

    Methods inherited from class org.elasticsearch.search.aggregations.bucket.BucketsAggregator

    bucketComparator, bucketDocCount, buildAggregationsForFixedBucketCount, buildAggregationsForSingleBucket, buildAggregationsForVariableBuckets, buildSubAggsForAllBuckets, buildSubAggsForBuckets, buildSubAggsForBuckets, close, collectBucket, collectExistingBucket, descendsFromGlobalAggregator, getDocCounts, grow, incrementBucketDocCount, maxBucketOrd, preGetSubLeafCollectors, resolveSortPath, rewriteBuckets

    Methods inherited from class org.elasticsearch.search.aggregations.AggregatorBase

    addRequestCircuitBreakerBytes, bigArrays, buildEmptySubAggregations, doPostCollection, doPreCollection, getLeafCollector, metadata, name, parent, pointReaderIfAvailable, preCollection, scoreMode, searcher, subAggregator, subAggregators, topLevelQuery, toString

    Methods inherited from class org.elasticsearch.search.aggregations.Aggregator

    buildAggregations, buildEmptyAggregation, buildTopLevel, collectDebugInfo, resolveSortPathOnValidAgg

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ParentJoinAggregator

      public ParentJoinAggregator​(java.lang.String name, org.elasticsearch.search.aggregations.AggregatorFactories factories, org.elasticsearch.search.aggregations.support.AggregationContext context, org.elasticsearch.search.aggregations.Aggregator parent, org.apache.lucene.search.Query inFilter, org.apache.lucene.search.Query outFilter, org.elasticsearch.search.aggregations.support.ValuesSource.Bytes.WithOrdinals valuesSource, long maxOrd, org.elasticsearch.search.aggregations.CardinalityUpperBound cardinality, java.util.Map<java.lang.String,​java.lang.Object> metadata) throws java.io.IOException
      Throws:
      java.io.IOException
  • Method Details

    • getLeafCollector

      public final org.elasticsearch.search.aggregations.LeafBucketCollector getLeafCollector​(org.apache.lucene.index.LeafReaderContext ctx, org.elasticsearch.search.aggregations.LeafBucketCollector sub) throws java.io.IOException
      Specified by:
      getLeafCollector in class org.elasticsearch.search.aggregations.AggregatorBase
      Throws:
      java.io.IOException
    • postCollection

      public void postCollection() throws java.io.IOException
      Overrides:
      postCollection in class org.elasticsearch.search.aggregations.AggregatorBase
      Throws:
      java.io.IOException
    • prepareSubAggs

      protected void prepareSubAggs​(long[] ordsToCollect) throws java.io.IOException
      Overrides:
      prepareSubAggs in class org.elasticsearch.search.aggregations.bucket.BucketsAggregator
      Throws:
      java.io.IOException
    • doClose

      protected void doClose()
      Overrides:
      doClose in class org.elasticsearch.search.aggregations.AggregatorBase