public abstract class AggregationBuilder extends ToXContentToBytes implements NamedWriteable, ToXContent, BaseAggregationBuilder
Aggregator
of a specific type.Modifier and Type | Class and Description |
---|---|
static class |
AggregationBuilder.CommonFields
Common xcontent fields shared among aggregator builders
|
Writeable.Reader<V>, Writeable.Writer<V>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
protected AggregatorFactories.Builder |
factoriesBuilder |
protected java.lang.String |
name |
EMPTY_PARAMS
Modifier | Constructor and Description |
---|---|
protected |
AggregationBuilder(java.lang.String name)
Constructs a new aggregation builder.
|
Modifier and Type | Method and Description |
---|---|
protected abstract AggregatorFactory<?> |
build(SearchContext context,
AggregatorFactory<?> parent)
Internal: build an
AggregatorFactory based on the configuration of this builder. |
java.lang.String |
getName()
Return this aggregation's name.
|
abstract AggregationBuilder |
setMetaData(java.util.Map<java.lang.String,java.lang.Object> metaData)
Associate metadata with this
AggregationBuilder . |
abstract AggregationBuilder |
subAggregation(AggregationBuilder aggregation)
Add a sub aggregation to this builder.
|
abstract AggregationBuilder |
subAggregation(PipelineAggregationBuilder aggregation)
Add a sub aggregation to this builder.
|
abstract AggregationBuilder |
subAggregations(AggregatorFactories.Builder subFactories)
Internal: Registers sub-factories with this factory.
|
buildAsBytes, buildAsBytes, toString, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getWriteableName
isFragment, toXContent
getType
protected final java.lang.String name
protected AggregatorFactories.Builder factoriesBuilder
protected AggregationBuilder(java.lang.String name)
name
- The aggregation namepublic java.lang.String getName()
protected abstract AggregatorFactory<?> build(SearchContext context, AggregatorFactory<?> parent) throws java.io.IOException
AggregatorFactory
based on the configuration of this builder.java.io.IOException
public abstract AggregationBuilder setMetaData(java.util.Map<java.lang.String,java.lang.Object> metaData)
AggregationBuilder
.setMetaData
in interface BaseAggregationBuilder
public abstract AggregationBuilder subAggregation(AggregationBuilder aggregation)
public abstract AggregationBuilder subAggregation(PipelineAggregationBuilder aggregation)
public abstract AggregationBuilder subAggregations(AggregatorFactories.Builder subFactories)
AggregatorFactories.parseAggregators(QueryParseContext)
.subAggregations
in interface BaseAggregationBuilder
subFactories
- The sub-factories