Package org.opensearch.join.aggregations
Class ParentJoinAggregator
- java.lang.Object
-
- org.opensearch.search.aggregations.BucketCollector
-
- org.opensearch.search.aggregations.Aggregator
-
- org.opensearch.search.aggregations.AggregatorBase
-
- org.opensearch.search.aggregations.bucket.BucketsAggregator
-
- org.opensearch.join.aggregations.ParentJoinAggregator
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,org.apache.lucene.search.Collector,Releasable,SingleBucketAggregator
- Direct Known Subclasses:
ChildrenToParentAggregator,ParentToChildrenAggregator
public abstract class ParentJoinAggregator extends BucketsAggregator implements SingleBucketAggregator
An aggregator that joins documents based on global ordinals. Global ordinals that match the main query and theinFilterquery are replayed with documents matching theoutFilterquery.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfaceParentJoinAggregator.CollectionStrategyStrategy for collecting the global ordinals of the join field in for all docs that match theParentJoinAggregator#inFilterand then checking if which of the docs in theParentJoinAggregator#outFilteralso have the ordinal.protected classParentJoinAggregator.DenseCollectionStrategyUses a dense, bit per ordinal representation of the join field in the docs that matchParentJoinAggregator#inFilter.protected classParentJoinAggregator.SparseCollectionStrategyUses a hashed representation of whether of the join field in the docs that matchParentJoinAggregator#inFilter.-
Nested classes/interfaces inherited from class org.opensearch.search.aggregations.bucket.BucketsAggregator
BucketsAggregator.BucketBuilderForFixedCount<B extends java.lang.Object>, BucketsAggregator.BucketBuilderForVariable<B extends java.lang.Object>, BucketsAggregator.ResultBuilderForVariable<B extends java.lang.Object>, BucketsAggregator.SingleBucketResultBuilder
-
Nested classes/interfaces inherited from class org.opensearch.search.aggregations.Aggregator
Aggregator.BucketComparator, Aggregator.Parser, Aggregator.SubAggCollectionMode
-
-
Field Summary
-
Fields inherited from class org.opensearch.search.aggregations.AggregatorBase
collectableSubAggregators, context, DEFAULT_WEIGHT, name, parent, subAggregators
-
Fields inherited from class org.opensearch.search.aggregations.BucketCollector
NO_OP_COLLECTOR
-
-
Constructor Summary
Constructors Constructor Description ParentJoinAggregator(java.lang.String name, AggregatorFactories factories, SearchContext context, Aggregator parent, org.apache.lucene.search.Query inFilter, org.apache.lucene.search.Query outFilter, ValuesSource.Bytes.WithOrdinals valuesSource, long maxOrd, CardinalityUpperBound cardinality, java.util.Map<java.lang.String,java.lang.Object> metadata)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbeforeBuildingBuckets(long[] ordsToCollect)protected voiddoClose()LeafBucketCollectorgetLeafCollector(LeafReaderContext ctx, LeafBucketCollector sub)voidpostCollection()-
Methods inherited from class org.opensearch.search.aggregations.bucket.BucketsAggregator
bucketComparator, bucketDocCount, buildAggregationsForFixedBucketCount, buildAggregationsForSingleBucket, buildAggregationsForVariableBuckets, buildSubAggsForAllBuckets, buildSubAggsForBuckets, buildSubAggsForBuckets, close, collectBucket, collectExistingBucket, descendsFromGlobalAggregator, getDocCounts, grow, incrementBucketDocCount, maxBucketOrd, mergeBuckets, mergeBuckets, resolveSortPath
-
Methods inherited from class org.opensearch.search.aggregations.AggregatorBase
addRequestCircuitBreakerBytes, buildEmptySubAggregations, context, doPostCollection, doPreCollection, getLeafCollector, metadata, name, parent, pointReaderIfAvailable, preCollection, preGetSubLeafCollectors, scoreMode, subAggregator, subAggregators, toString
-
Methods inherited from class org.opensearch.search.aggregations.Aggregator
buildAggregations, buildEmptyAggregation, buildTopLevel, collectDebugInfo, resolveSortPathOnValidAgg
-
-
-
-
Constructor Detail
-
ParentJoinAggregator
public ParentJoinAggregator(java.lang.String name, AggregatorFactories factories, SearchContext context, Aggregator parent, org.apache.lucene.search.Query inFilter, org.apache.lucene.search.Query outFilter, ValuesSource.Bytes.WithOrdinals valuesSource, long maxOrd, CardinalityUpperBound cardinality, java.util.Map<java.lang.String,java.lang.Object> metadata) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Detail
-
getLeafCollector
public final LeafBucketCollector getLeafCollector(LeafReaderContext ctx, LeafBucketCollector sub) throws java.io.IOException
- Specified by:
getLeafCollectorin classAggregatorBase- Throws:
java.io.IOException
-
postCollection
public void postCollection() throws java.io.IOException- Overrides:
postCollectionin classAggregatorBase- Throws:
java.io.IOException
-
beforeBuildingBuckets
protected void beforeBuildingBuckets(long[] ordsToCollect) throws java.io.IOException- Overrides:
beforeBuildingBucketsin classBucketsAggregator- Throws:
java.io.IOException
-
doClose
protected void doClose()
- Overrides:
doClosein classAggregatorBase
-
-