Class RangeAggregator
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.search.aggregations.bucket.range.RangeAggregator
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.lucene.search.Collector
,org.opensearch.common.lease.Releasable
Aggregate all docs that match given ranges.
- Opensearch.internal:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Range for the range aggregatorstatic class
Unmapped rangeNested classes/interfaces inherited from class org.opensearch.search.aggregations.bucket.BucketsAggregator
BucketsAggregator.BucketBuilderForFixedCount<B>, BucketsAggregator.BucketBuilderForVariable<B>, BucketsAggregator.ResultBuilderForVariable<B>, BucketsAggregator.SingleBucketResultBuilder
Nested classes/interfaces inherited from class org.opensearch.search.aggregations.Aggregator
Aggregator.BucketComparator, Aggregator.Parser, Aggregator.SubAggCollectionMode
-
Field Summary
Modifier and TypeFieldDescriptionstatic final org.opensearch.core.ParseField
static final org.opensearch.core.ParseField
Fields inherited from class org.opensearch.search.aggregations.bucket.BucketsAggregator
docCountProvider
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
ConstructorDescriptionRangeAggregator
(String name, AggregatorFactories factories, ValuesSource.Numeric valuesSource, DocValueFormat format, InternalRange.Factory rangeFactory, RangeAggregator.Range[] ranges, boolean keyed, SearchContext context, Aggregator parent, CardinalityUpperBound cardinality, Map<String, Object> metadata, ValuesSourceConfig config) -
Method Summary
Modifier and TypeMethodDescriptionbuildAggregations
(long[] owningBucketOrds) Build the results of this aggregation.Build an empty aggregation.void
Collect debug information to add to the profiling results.getLeafCollector
(org.apache.lucene.index.LeafReaderContext ctx, LeafBucketCollector sub) Get aLeafBucketCollector
for the given ctx, which should delegate to the given collector.org.apache.lucene.search.ScoreMode
Most aggregators don't need scores, make sure to extend this method if your aggregator needs them.Methods inherited from class org.opensearch.search.aggregations.bucket.BucketsAggregator
beforeBuildingBuckets, bucketComparator, bucketDocCount, buildAggregationsForFixedBucketCount, buildAggregationsForSingleBucket, buildAggregationsForVariableBuckets, buildSubAggsForAllBuckets, buildSubAggsForBuckets, buildSubAggsForBuckets, close, collectBucket, collectExistingBucket, descendsFromGlobalAggregator, getDocCounts, grow, incrementBucketDocCount, maxBucketOrd, mergeBuckets, mergeBuckets, preGetSubLeafCollectors, resolveSortPath
Methods inherited from class org.opensearch.search.aggregations.AggregatorBase
addRequestCircuitBreakerBytes, buildEmptySubAggregations, context, doClose, doPostCollection, doPreCollection, getLeafCollector, metadata, name, parent, pointReaderIfAvailable, postCollection, preCollection, subAggregator, subAggregators, toString
Methods inherited from class org.opensearch.search.aggregations.Aggregator
buildTopLevel, getPostCollectionAggregation, resolveSortPathOnValidAgg
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.lucene.search.Collector
setWeight
-
Field Details
-
RANGES_FIELD
public static final org.opensearch.core.ParseField RANGES_FIELD -
KEYED_FIELD
public static final org.opensearch.core.ParseField KEYED_FIELD
-
-
Constructor Details
-
RangeAggregator
public RangeAggregator(String name, AggregatorFactories factories, ValuesSource.Numeric valuesSource, DocValueFormat format, InternalRange.Factory rangeFactory, RangeAggregator.Range[] ranges, boolean keyed, SearchContext context, Aggregator parent, CardinalityUpperBound cardinality, Map<String, Object> metadata, ValuesSourceConfig config) throws IOException- Throws:
IOException
-
-
Method Details
-
scoreMode
public org.apache.lucene.search.ScoreMode scoreMode()Description copied from class:AggregatorBase
Most aggregators don't need scores, make sure to extend this method if your aggregator needs them.- Specified by:
scoreMode
in interfaceorg.apache.lucene.search.Collector
- Overrides:
scoreMode
in classAggregatorBase
-
getLeafCollector
public LeafBucketCollector getLeafCollector(org.apache.lucene.index.LeafReaderContext ctx, LeafBucketCollector sub) throws IOException Description copied from class:AggregatorBase
Get aLeafBucketCollector
for the given ctx, which should delegate to the given collector.- Specified by:
getLeafCollector
in classAggregatorBase
- Throws:
IOException
-
buildAggregations
Description copied from class:Aggregator
Build the results of this aggregation.- Specified by:
buildAggregations
in classAggregator
- Parameters:
owningBucketOrds
- the ordinals of the buckets that we want to collect from this aggregation- Returns:
- the results for each ordinal, in the same order as the array of ordinals
- Throws:
IOException
-
buildEmptyAggregation
Description copied from class:Aggregator
Build an empty aggregation.- Specified by:
buildEmptyAggregation
in classAggregator
-
collectDebugInfo
Description copied from class:Aggregator
Collect debug information to add to the profiling results. This will only be called if the aggregation is being profiled.Well behaved implementations will always call the superclass implementation just in case it has something interesting. They will also only add objects which can be serialized with
StreamOutput.writeGenericValue(Object)
andXContentBuilder.value(Object)
. And they'll have an integration test.- Overrides:
collectDebugInfo
in classAggregator
-