Class AbstractAggregationBuilder<AB extends AbstractAggregationBuilder<AB>>
org.elasticsearch.search.aggregations.AggregationBuilder
org.elasticsearch.search.aggregations.AbstractAggregationBuilder<AB>
- All Implemented Interfaces:
NamedWriteable
,Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentFragment
,Rewriteable<AggregationBuilder>
,BaseAggregationBuilder
- Direct Known Subclasses:
AdjacencyMatrixAggregationBuilder
,CompositeAggregationBuilder
,FilterAggregationBuilder
,FiltersAggregationBuilder
,GlobalAggregationBuilder
,MultiValuesSourceAggregationBuilder
,NestedAggregationBuilder
,ReverseNestedAggregationBuilder
,SamplerAggregationBuilder
,ScriptedMetricAggregationBuilder
,SignificantTextAggregationBuilder
,TopHitsAggregationBuilder
,ValuesSourceAggregationBuilder
public abstract class AbstractAggregationBuilder<AB extends AbstractAggregationBuilder<AB>>
extends AggregationBuilder
Base implementation of a
AggregationBuilder
.-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
AggregationBuilder.BucketCardinality, AggregationBuilder.CommonFields
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.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.AggregationBuilder
DEFAULT_PREALLOCATION, factoriesBuilder, name
Fields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDS
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ModifierConstructorDescriptionname)
Constructs a new aggregation builder.protected
Read from a stream.protected
AbstractAggregationBuilder(AbstractAggregationBuilder<AB> clone, AggregatorFactories.Builder factoriesBuilder, <,> metadata)
-
Method Summary
Modifier and TypeMethodDescriptionbuild(AggregationContext context, AggregatorFactory parent)
Internal: build anAggregatorFactory
based on the configuration of this builder.protected abstract AggregatorFactory
doBuild(AggregationContext context, AggregatorFactory parent, AggregatorFactories.Builder subfactoriesBuilder)
protected abstract void
doWriteTo(StreamOutput out)
boolean
obj)
<,>
Return any associated metadata with thisAggregationBuilder
.Returns the name of the writeable objectint
hashCode()
protected abstract org.elasticsearch.common.xcontent.XContentBuilder
internalXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
<,> metadata)
Associate metadata with thisAggregationBuilder
.subAggregation(AggregationBuilder aggregation)
Add a sub aggregation to this builder.subAggregation(PipelineAggregationBuilder aggregation)
Add a sub aggregation to this aggregation.subAggregations(AggregatorFactories.Builder subFactories)
Registers sub-factories with this factory.org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
void
writeTo(StreamOutput out)
Write this into the StreamOutput.Methods inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
bucketCardinality, buildPipelineTree, bytesToPreallocate, doRewrite, getName, getOutputFieldNames, getPipelineAggregations, getSubAggregations, rewrite, shallowCopy, toString
Methods inherited from class java.lang.
, , , , , , ,
Methods inherited from interface org.elasticsearch.search.aggregations.BaseAggregationBuilder
getType
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Field Details
-
metadata
protected <,> metadata
-
-
Constructor Details
-
AbstractAggregationBuilder
public AbstractAggregationBuilder( name)Constructs a new aggregation builder.- Parameters:
name
- The aggregation name
-
AbstractAggregationBuilder
protected AbstractAggregationBuilder(AbstractAggregationBuilder<AB> clone, AggregatorFactories.Builder factoriesBuilder, <,> metadata) -
AbstractAggregationBuilder
Read from a stream.- Throws:
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Throws:
-
doWriteTo
- Throws:
-
subAggregation
Description copied from class:AggregationBuilder
Add a sub aggregation to this builder.- Specified by:
subAggregation
in classAggregationBuilder
-
subAggregation
Add a sub aggregation to this aggregation.- Specified by:
subAggregation
in classAggregationBuilder
-
subAggregations
Registers sub-factories with this factory. The sub-factory will be responsible for the creation of sub-aggregators under the aggregator created by this factory.- Specified by:
subAggregations
in interfaceBaseAggregationBuilder
- Specified by:
subAggregations
in classAggregationBuilder
- Parameters:
subFactories
- The sub-factories- Returns:
- this factory (fluent interface)
-
setMetadata
public <,> metadata)Description copied from class:AggregationBuilder
Associate metadata with thisAggregationBuilder
.- Specified by:
setMetadata
in interfaceBaseAggregationBuilder
- Specified by:
setMetadata
in classAggregationBuilder
-
getMetadata
public <,> getMetadata()Description copied from class:AggregationBuilder
Return any associated metadata with thisAggregationBuilder
.- Specified by:
getMetadata
in classAggregationBuilder
-
getWriteableName
public final getWriteableName()Description copied from interface:NamedWriteable
Returns the name of the writeable object -
build
Description copied from class:AggregationBuilder
Internal: build anAggregatorFactory
based on the configuration of this builder.- Specified by:
build
in classAggregationBuilder
- Throws:
-
doBuild
protected abstract AggregatorFactory doBuild(AggregationContext context, AggregatorFactory parent, AggregatorFactories.Builder subfactoriesBuilder) throws- Throws:
-
toXContent
public final org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws- Throws:
-
internalXContent
protected abstract org.elasticsearch.common.xcontent.XContentBuilder internalXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws- Throws:
-
hashCode
public int hashCode()- Overrides:
in class
-
equals
public boolean equals( obj)- Overrides:
in class
-