public class RangeBuilder extends AbstractRangeBuilder<RangeBuilder>
AbstractRangeBuilder.Range
aggregation.AbstractRangeBuilder.Range
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
ranges
type
EMPTY_PARAMS
Constructor and Description |
---|
RangeBuilder(String name)
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
RangeBuilder |
addRange(double from,
double to)
Same as
addRange(String, double, double) but the key will be
automatically generated based on from and to . |
RangeBuilder |
addRange(String key,
double from,
double to)
Add a new range to this aggregation.
|
RangeBuilder |
addUnboundedFrom(double from)
Same as
addUnboundedFrom(String, double) but the key will be
computed automatically. |
RangeBuilder |
addUnboundedFrom(String key,
double from)
Add a new range with no upper bound.
|
RangeBuilder |
addUnboundedTo(double to)
Same as
addUnboundedTo(String, double) but the key will be
computed automatically. |
RangeBuilder |
addUnboundedTo(String key,
double to)
Add a new range with no lower bound.
|
protected XContentBuilder |
doInternalXContent(XContentBuilder builder,
ToXContent.Params params) |
RangeBuilder |
format(String format)
Set the format to use to display values.
|
field, internalXContent, missing, script
setMetaData, subAggregation, subAggregation, subAggregation, subAggregation, subAggregation, subAggregation, toXContent
getName
public RangeBuilder(String name)
public RangeBuilder addRange(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 RangeBuilder addRange(double from, double to)
addRange(String, double, double)
but the key will be
automatically generated based on from
and to
.public RangeBuilder addUnboundedTo(String key, double to)
key
- the key to use for this range in the responseto
- the upper bound on the distances, exclusivepublic RangeBuilder addUnboundedTo(double to)
addUnboundedTo(String, double)
but the key will be
computed automatically.public RangeBuilder addUnboundedFrom(String key, double from)
key
- the key to use for this range in the responsefrom
- the lower bound on the distances, inclusivepublic RangeBuilder addUnboundedFrom(double from)
addUnboundedFrom(String, double)
but the key will be
computed automatically.public RangeBuilder format(String format)
protected XContentBuilder doInternalXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
doInternalXContent
in class AbstractRangeBuilder<RangeBuilder>
IOException
Copyright © 2009–2016. All rights reserved.