Class InternalMultiBucketAggregation<A extends InternalMultiBucketAggregation,B extends InternalMultiBucketAggregation.InternalBucket>
java.lang.Object
org.elasticsearch.search.aggregations.InternalAggregation
org.elasticsearch.search.aggregations.InternalMultiBucketAggregation<A,B>
- All Implemented Interfaces:
NamedWriteable,Writeable,ToXContent,ToXContentFragment,Aggregation,MultiBucketsAggregation
- Direct Known Subclasses:
InternalAdjacencyMatrix,InternalAutoDateHistogram,InternalBinaryRange,InternalComposite,InternalDateHistogram,InternalFilters,InternalGeoGrid,InternalHistogram,InternalRange,InternalRareTerms,InternalSignificantTerms,InternalTerms
public abstract class InternalMultiBucketAggregation<A extends InternalMultiBucketAggregation,B extends InternalMultiBucketAggregation.InternalBucket> extends InternalAggregation implements MultiBucketsAggregation
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classInternalMultiBucketAggregation.InternalBucketNested classes/interfaces inherited from class org.elasticsearch.search.aggregations.InternalAggregation
InternalAggregation.ReduceContextNested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.Aggregation
Aggregation.CommonFieldsNested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation
MultiBucketsAggregation.BucketNested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from class org.elasticsearch.search.aggregations.InternalAggregation
metaData, nameFields inherited from interface org.elasticsearch.search.aggregations.Aggregation
TYPED_KEYS_DELIMITER -
Constructor Summary
Constructors Modifier Constructor Description InternalMultiBucketAggregation(java.lang.String name, java.util.List<PipelineAggregator> pipelineAggregators, java.util.Map<java.lang.String,java.lang.Object> metaData)protectedInternalMultiBucketAggregation(StreamInput in)Read from a stream. -
Method Summary
Modifier and Type Method Description static intcountInnerBucket(Aggregation agg)Counts the number of inner buckets inside the providedAggregationstatic intcountInnerBucket(InternalMultiBucketAggregation.InternalBucket bucket)Counts the number of inner buckets inside the providedInternalMultiBucketAggregation.InternalBucketabstract Acreate(java.util.List<B> buckets)Create a new copy of thisAggregationwith the same settings as thisAggregationand contains the provided buckets.abstract BcreateBucket(InternalAggregations aggregations, B prototype)Create a newInternalMultiBucketAggregation.InternalBucketusing the provided prototype bucket and aggregations.abstract java.util.List<B>getBuckets()java.lang.ObjectgetProperty(java.util.List<java.lang.String> path)protected abstract BreduceBucket(java.util.List<B> buckets, InternalAggregation.ReduceContext context)Reduce a list of same-keyed buckets (from multiple shards) to a single bucket.InternalAggregationreducePipelines(InternalAggregation reducedAggs, InternalAggregation.ReduceContext reduceContext)UnlikeInternalAggregation.reducePipelines(InternalAggregation, ReduceContext), a multi-bucket agg needs to first reduce the buckets (and their parent pipelines) before allowing sibling pipelines to materializeMethods inherited from class org.elasticsearch.search.aggregations.InternalAggregation
doWriteTo, doXContentBody, equals, getMetaData, getName, getProperty, getType, hashCode, isMapped, pipelineAggregators, readSize, reduce, toString, toXContent, writeSize, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.search.aggregations.Aggregation
getMetaData, getName, getType
-
Constructor Details
-
InternalMultiBucketAggregation
public InternalMultiBucketAggregation(java.lang.String name, java.util.List<PipelineAggregator> pipelineAggregators, java.util.Map<java.lang.String,java.lang.Object> metaData) -
InternalMultiBucketAggregation
Read from a stream.- Throws:
java.io.IOException
-
-
Method Details
-
create
Create a new copy of thisAggregationwith the same settings as thisAggregationand contains the provided buckets.- Parameters:
buckets- the buckets to use in the newAggregation- Returns:
- the new
Aggregation
-
createBucket
Create a newInternalMultiBucketAggregation.InternalBucketusing the provided prototype bucket and aggregations.- Parameters:
aggregations- the aggregations for the new bucketprototype- the bucket to use as a prototype- Returns:
- the new bucket
-
reduceBucket
protected abstract B reduceBucket(java.util.List<B> buckets, InternalAggregation.ReduceContext context)Reduce a list of same-keyed buckets (from multiple shards) to a single bucket. This requires all buckets to have the same key. -
getBuckets
- Specified by:
getBucketsin interfaceMultiBucketsAggregation- Returns:
- The buckets of this aggregation.
-
getProperty
public java.lang.Object getProperty(java.util.List<java.lang.String> path)- Specified by:
getPropertyin classInternalAggregation
-
countInnerBucket
Counts the number of inner buckets inside the providedInternalMultiBucketAggregation.InternalBucket -
countInnerBucket
Counts the number of inner buckets inside the providedAggregation -
reducePipelines
public final InternalAggregation reducePipelines(InternalAggregation reducedAggs, InternalAggregation.ReduceContext reduceContext)UnlikeInternalAggregation.reducePipelines(InternalAggregation, ReduceContext), a multi-bucket agg needs to first reduce the buckets (and their parent pipelines) before allowing sibling pipelines to materialize- Overrides:
reducePipelinesin classInternalAggregation
-