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