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 aAggregationBuilder
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
AggregationBuilder.CommonFields
-
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 Modifier and Type Field Description protected java.util.Map<java.lang.String,java.lang.Object>
metaData
-
Fields inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
factoriesBuilder, name
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Modifier Constructor Description AbstractAggregationBuilder(java.lang.String name)
Constructs a new aggregation builder.protected
AbstractAggregationBuilder(StreamInput in)
Read from a stream.protected
AbstractAggregationBuilder(AbstractAggregationBuilder<AB> clone, AggregatorFactories.Builder factoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metaData)
-
Method Summary
Modifier and Type Method Description AggregatorFactory<?>
build(SearchContext context, AggregatorFactory<?> parent)
Internal: build anAggregatorFactory
based on the configuration of this builder.protected abstract AggregatorFactory<?>
doBuild(SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subfactoriesBuilder)
protected abstract boolean
doEquals(java.lang.Object obj)
protected abstract int
doHashCode()
protected abstract void
doWriteTo(StreamOutput out)
boolean
equals(java.lang.Object obj)
java.util.Map<java.lang.String,java.lang.Object>
getMetaData()
Return any associated metadata with thisAggregationBuilder
.java.lang.String
getWriteableName()
Returns the name of the writeable objectint
hashCode()
protected abstract XContentBuilder
internalXContent(XContentBuilder builder, ToXContent.Params params)
AB
setMetaData(java.util.Map<java.lang.String,java.lang.Object> metaData)
Associate metadata with thisAggregationBuilder
.AB
subAggregation(AggregationBuilder aggregation)
Add a sub aggregation to this builder.AB
subAggregation(PipelineAggregationBuilder aggregation)
Add a sub aggregation to this aggregation.AB
subAggregations(AggregatorFactories.Builder subFactories)
Registers sub-factories with this factory.XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
void
writeTo(StreamOutput out)
Write this into the StreamOutput.-
Methods inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
doRewrite, getName, getPipelineAggregations, getSubAggregations, rewrite, shallowCopy, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.search.aggregations.BaseAggregationBuilder
getType
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Constructor Detail
-
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
protected AbstractAggregationBuilder(StreamInput in) throws java.io.IOException
Read from a stream.- Throws:
java.io.IOException
-
-
Method Detail
-
writeTo
public final void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Writeable
Write this into the StreamOutput.- Throws:
java.io.IOException
-
doWriteTo
protected abstract void doWriteTo(StreamOutput out) throws java.io.IOException
- Throws:
java.io.IOException
-
subAggregation
public AB subAggregation(AggregationBuilder aggregation)
Description copied from class:AggregationBuilder
Add a sub aggregation to this builder.- Specified by:
subAggregation
in classAggregationBuilder
-
subAggregation
public AB subAggregation(PipelineAggregationBuilder aggregation)
Add a sub aggregation to this aggregation.- Specified by:
subAggregation
in classAggregationBuilder
-
subAggregations
public AB subAggregations(AggregatorFactories.Builder subFactories)
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 AB setMetaData(java.util.Map<java.lang.String,java.lang.Object> metaData)
Description copied from class:AggregationBuilder
Associate metadata with thisAggregationBuilder
.- Specified by:
setMetaData
in interfaceBaseAggregationBuilder
- Specified by:
setMetaData
in classAggregationBuilder
-
getMetaData
public java.util.Map<java.lang.String,java.lang.Object> getMetaData()
Description copied from class:AggregationBuilder
Return any associated metadata with thisAggregationBuilder
.- Specified by:
getMetaData
in classAggregationBuilder
-
getWriteableName
public final java.lang.String getWriteableName()
Description copied from interface:NamedWriteable
Returns the name of the writeable object
-
build
public final AggregatorFactory<?> build(SearchContext context, AggregatorFactory<?> parent) throws java.io.IOException
Description copied from class:AggregationBuilder
Internal: build anAggregatorFactory
based on the configuration of this builder.- Specified by:
build
in classAggregationBuilder
- Throws:
java.io.IOException
-
doBuild
protected abstract AggregatorFactory<?> doBuild(SearchContext context, 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:
hashCode
in classjava.lang.Object
-
doHashCode
protected abstract int doHashCode()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
doEquals
protected abstract boolean doEquals(java.lang.Object obj)
-
-