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 class
InternalMultiBucketAggregation.InternalBucket
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.InternalAggregation
InternalAggregation.ReduceContext
Nested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.Aggregation
Aggregation.CommonFields
Nested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation
MultiBucketsAggregation.Bucket
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Nested 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, name
Fields 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)
protected
InternalMultiBucketAggregation(StreamInput in)
Read from a stream. -
Method Summary
Modifier and Type Method Description static int
countInnerBucket(Aggregation agg)
Counts the number of inner buckets inside the providedAggregation
static int
countInnerBucket(InternalMultiBucketAggregation.InternalBucket bucket)
Counts the number of inner buckets inside the providedInternalMultiBucketAggregation.InternalBucket
abstract A
create(java.util.List<B> buckets)
Create a new copy of thisAggregation
with the same settings as thisAggregation
and contains the provided buckets.abstract B
createBucket(InternalAggregations aggregations, B prototype)
Create a newInternalMultiBucketAggregation.InternalBucket
using the provided prototype bucket and aggregations.abstract java.util.List<B>
getBuckets()
java.lang.Object
getProperty(java.util.List<java.lang.String> path)
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.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 materializeMethods inherited from class org.elasticsearch.search.aggregations.InternalAggregation
doWriteTo, doXContentBody, equals, getMetaData, getName, getProperty, getType, hashCode, isMapped, pipelineAggregators, readSize, reduce, toString, toXContent, writeSize, writeTo
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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 thisAggregation
with the same settings as thisAggregation
and contains the provided buckets.- Parameters:
buckets
- the buckets to use in the newAggregation
- Returns:
- the new
Aggregation
-
createBucket
Create a newInternalMultiBucketAggregation.InternalBucket
using 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:
getBuckets
in interfaceMultiBucketsAggregation
- Returns:
- The buckets of this aggregation.
-
getProperty
public java.lang.Object getProperty(java.util.List<java.lang.String> path)- Specified by:
getProperty
in 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:
reducePipelines
in classInternalAggregation
-