NamedWriteable
, Writeable
, ToXContent
, ToXContentFragment
, BaseAggregationBuilder
, MultiBucketAggregationBuilder
public class RangeAggregationBuilder extends AbstractRangeBuilder<RangeAggregationBuilder,RangeAggregator.Range>
AggregationBuilder.CommonFields
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
ValuesSourceAggregationBuilder.LeafOnly<VS extends ValuesSource,AB extends ValuesSourceAggregationBuilder<VS,AB>>
Writeable.Reader<V>, Writeable.Writer<V>
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
NAME |
metaData
keyed, rangeFactory, ranges
factoriesBuilder, name
EMPTY_PARAMS
config
Constructor | Description |
---|---|
RangeAggregationBuilder(java.lang.String name) |
|
RangeAggregationBuilder(StreamInput in) |
Read from a stream.
|
Modifier and Type | Method | Description |
---|---|---|
RangeAggregationBuilder |
addRange(double from,
double to) |
Same as
addRange(String, double, double) but the key will be
automatically generated based on from and
to . |
RangeAggregationBuilder |
addRange(java.lang.String key,
double from,
double to) |
Add a new range to this aggregation.
|
RangeAggregationBuilder |
addUnboundedFrom(double from) |
Same as
addUnboundedFrom(String, double) but the key will be
computed automatically. |
RangeAggregationBuilder |
addUnboundedFrom(java.lang.String key,
double from) |
Add a new range with no upper bound.
|
RangeAggregationBuilder |
addUnboundedTo(double to) |
Same as
addUnboundedTo(String, double) but the key will be
computed automatically. |
RangeAggregationBuilder |
addUnboundedTo(java.lang.String key,
double to) |
Add a new range with no lower bound.
|
java.lang.String |
getType() |
The name of the type of aggregation built by this builder.
|
protected RangeAggregatorFactory |
innerBuild(SearchContext context,
ValuesSourceConfig<ValuesSource.Numeric> config,
AggregatorFactory<?> parent,
AggregatorFactories.Builder subFactoriesBuilder) |
|
static AggregationBuilder |
parse(java.lang.String aggregationName,
XContentParser parser) |
build, equals, getMetaData, getWriteableName, hashCode, setMetaData, subAggregation, subAggregation, subAggregations, toXContent, writeTo
addRange, doXContentBody, innerEquals, innerHashCode, innerWriteTo, keyed, keyed, processRanges, ranges
doRewrite, getName, getPipelineAggregations, getSubAggregations, rewrite, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isFragment
doBuild, doEquals, doHashCode, doWriteTo, field, field, format, format, internalXContent, missing, missing, resolveConfig, script, script, serializeTargetValueType, timeZone, timeZone, valueType, valueType
public static final java.lang.String NAME
public RangeAggregationBuilder(java.lang.String name)
public RangeAggregationBuilder(StreamInput in) throws java.io.IOException
java.io.IOException
public static AggregationBuilder parse(java.lang.String aggregationName, XContentParser parser) throws java.io.IOException
java.io.IOException
public RangeAggregationBuilder addRange(java.lang.String key, double from, double to)
key
- the key to use for this range in the responsefrom
- the lower bound on the distances, inclusiveto
- the upper bound on the distances, exclusivepublic RangeAggregationBuilder addRange(double from, double to)
addRange(String, double, double)
but the key will be
automatically generated based on from
and
to
.public RangeAggregationBuilder addUnboundedTo(java.lang.String key, double to)
key
- the key to use for this range in the responseto
- the upper bound on the distances, exclusivepublic RangeAggregationBuilder addUnboundedTo(double to)
addUnboundedTo(String, double)
but the key will be
computed automatically.public RangeAggregationBuilder addUnboundedFrom(java.lang.String key, double from)
key
- the key to use for this range in the responsefrom
- the lower bound on the distances, inclusivepublic RangeAggregationBuilder addUnboundedFrom(double from)
addUnboundedFrom(String, double)
but the key will be
computed automatically.protected RangeAggregatorFactory innerBuild(SearchContext context, ValuesSourceConfig<ValuesSource.Numeric> config, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder) throws java.io.IOException
innerBuild
in class ValuesSourceAggregationBuilder<ValuesSource.Numeric,RangeAggregationBuilder>
java.io.IOException
public java.lang.String getType()
BaseAggregationBuilder