Class AbstractAggregationBuilder<AB extends AbstractAggregationBuilder<AB>>
java.lang.Object
org.elasticsearch.search.aggregations.AggregationBuilder
org.elasticsearch.search.aggregations.AbstractAggregationBuilder<AB>
- All Implemented Interfaces:
NamedWriteable,Writeable,ToXContent,ToXContentFragment,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.CommonFieldsNested 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 Modifier and Type Field Description protected java.util.Map<java.lang.String,java.lang.Object>metaDataFields inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
factoriesBuilder, name -
Constructor Summary
Constructors Modifier Constructor Description AbstractAggregationBuilder(java.lang.String name)Constructs a new aggregation builder.protectedAbstractAggregationBuilder(StreamInput in)Read from a stream.protectedAbstractAggregationBuilder(AbstractAggregationBuilder<AB> clone, AggregatorFactories.Builder factoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metaData) -
Method Summary
Modifier and Type Method Description AggregatorFactorybuild(QueryShardContext queryShardContext, AggregatorFactory parent)Internal: build anAggregatorFactorybased on the configuration of this builder.protected abstract AggregatorFactorydoBuild(QueryShardContext queryShardContext, AggregatorFactory parent, AggregatorFactories.Builder subfactoriesBuilder)protected abstract voiddoWriteTo(StreamOutput out)booleanequals(java.lang.Object obj)java.util.Map<java.lang.String,java.lang.Object>getMetaData()Return any associated metadata with thisAggregationBuilder.java.lang.StringgetWriteableName()Returns the name of the writeable objectinthashCode()protected abstract XContentBuilderinternalXContent(XContentBuilder builder, ToXContent.Params params)ABsetMetaData(java.util.Map<java.lang.String,java.lang.Object> metaData)Associate metadata with thisAggregationBuilder.ABsubAggregation(AggregationBuilder aggregation)Add a sub aggregation to this builder.ABsubAggregation(PipelineAggregationBuilder aggregation)Add a sub aggregation to this aggregation.ABsubAggregations(AggregatorFactories.Builder subFactories)Registers sub-factories with this factory.XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)voidwriteTo(StreamOutput out)Write this into the StreamOutput.Methods inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
doRewrite, getName, getPipelineAggregations, getSubAggregations, rewrite, shallowCopy, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.search.aggregations.BaseAggregationBuilder
getType
-
Field Details
-
metaData
protected java.util.Map<java.lang.String,java.lang.Object> metaData
-
-
Constructor Details
-
AbstractAggregationBuilder
public AbstractAggregationBuilder(java.lang.String name)Constructs a new aggregation builder.- Parameters:
name- The aggregation name
-
AbstractAggregationBuilder
protected AbstractAggregationBuilder(AbstractAggregationBuilder<AB> clone, AggregatorFactories.Builder factoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metaData) -
AbstractAggregationBuilder
Read from a stream.- Throws:
java.io.IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Throws:
java.io.IOException
-
doWriteTo
- Throws:
java.io.IOException
-
subAggregation
Description copied from class:AggregationBuilderAdd a sub aggregation to this builder.- Specified by:
subAggregationin classAggregationBuilder
-
subAggregation
Add a sub aggregation to this aggregation.- Specified by:
subAggregationin 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:
subAggregationsin interfaceBaseAggregationBuilder- Specified by:
subAggregationsin classAggregationBuilder- Parameters:
subFactories- The sub-factories- Returns:
- this factory (fluent interface)
-
setMetaData
Description copied from class:AggregationBuilderAssociate metadata with thisAggregationBuilder.- Specified by:
setMetaDatain interfaceBaseAggregationBuilder- Specified by:
setMetaDatain classAggregationBuilder
-
getMetaData
public java.util.Map<java.lang.String,java.lang.Object> getMetaData()Description copied from class:AggregationBuilderReturn any associated metadata with thisAggregationBuilder.- Specified by:
getMetaDatain classAggregationBuilder
-
getWriteableName
public final java.lang.String getWriteableName()Description copied from interface:NamedWriteableReturns the name of the writeable object -
build
public final AggregatorFactory build(QueryShardContext queryShardContext, AggregatorFactory parent) throws java.io.IOExceptionDescription copied from class:AggregationBuilderInternal: build anAggregatorFactorybased on the configuration of this builder.- Specified by:
buildin classAggregationBuilder- Throws:
java.io.IOException
-
doBuild
protected abstract AggregatorFactory doBuild(QueryShardContext queryShardContext, AggregatorFactory parent, AggregatorFactories.Builder subfactoriesBuilder) throws java.io.IOException- Throws:
java.io.IOException
-
toXContent
public final XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Throws:
java.io.IOException
-
internalXContent
protected abstract XContentBuilder internalXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Throws:
java.io.IOException
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equalsin classjava.lang.Object
-