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