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,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.CommonFieldsNested 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.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
DEFAULT_PREALLOCATION, factoriesBuilder, nameFields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDSFields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
ConstructorsModifierConstructorDescriptionConstructs a new aggregation builder.protectedRead from a stream.protectedAbstractAggregationBuilder(AbstractAggregationBuilder<AB> clone, AggregatorFactories.Builder factoriesBuilder, Map<String,Object> metadata) -
Method Summary
Modifier and TypeMethodDescriptionbuild(AggregationContext context, AggregatorFactory parent)Internal: build anAggregatorFactorybased on the configuration of this builder.protected abstract AggregatorFactorydoBuild(AggregationContext context, AggregatorFactory parent, AggregatorFactories.Builder subfactoriesBuilder)protected abstract voiddoWriteTo(StreamOutput out)booleanReturn any associated metadata with thisAggregationBuilder.Returns the name of the writeable objectinthashCode()protected abstract org.elasticsearch.common.xcontent.XContentBuilderinternalXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)setMetadata(Map<String,Object> 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.XContentBuildertoXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)voidwriteTo(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, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.search.aggregations.BaseAggregationBuilder
getTypeMethods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Field Details
-
metadata
-
-
Constructor Details
-
AbstractAggregationBuilder
Constructs a new aggregation builder.- Parameters:
name- The aggregation name
-
AbstractAggregationBuilder
protected AbstractAggregationBuilder(AbstractAggregationBuilder<AB> clone, AggregatorFactories.Builder factoriesBuilder, Map<String,Object> metadata) -
AbstractAggregationBuilder
Read from a stream.- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Throws:
IOException
-
doWriteTo
- Throws:
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
Description copied from class:AggregationBuilderReturn any associated metadata with thisAggregationBuilder.- Specified by:
getMetadatain classAggregationBuilder
-
getWriteableName
Description copied from interface:NamedWriteableReturns the name of the writeable object -
build
public final AggregatorFactory build(AggregationContext context, AggregatorFactory parent) throws IOExceptionDescription copied from class:AggregationBuilderInternal: build anAggregatorFactorybased on the configuration of this builder.- Specified by:
buildin classAggregationBuilder- Throws:
IOException
-
doBuild
protected abstract AggregatorFactory doBuild(AggregationContext context, AggregatorFactory parent, AggregatorFactories.Builder subfactoriesBuilder) throws IOException- Throws:
IOException
-
toXContent
public final org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Throws:
IOException
-
internalXContent
protected abstract org.elasticsearch.common.xcontent.XContentBuilder internalXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Throws:
IOException
-
hashCode
public int hashCode() -
equals
-