public class DateHistogramAggregationBuilder extends ValuesSourceAggregationBuilder<ValuesSource.Numeric,DateHistogramAggregationBuilder>
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.util.Map<java.lang.String,DateTimeUnit> |
DATE_FIELD_UNITS |
static java.lang.String |
NAME |
config
metaData
factoriesBuilder, name
EMPTY_PARAMS
Constructor and Description |
---|
DateHistogramAggregationBuilder(StreamInput in)
Read from a stream, for internal use only.
|
DateHistogramAggregationBuilder(java.lang.String name)
Create a new builder with the given name.
|
Modifier and Type | Method and Description |
---|---|
DateHistogramInterval |
dateHistogramInterval()
Get the current date interval that is set on this builder.
|
DateHistogramAggregationBuilder |
dateHistogramInterval(DateHistogramInterval dateHistogramInterval)
Set the interval on this builder, and return the builder so that calls can be chained.
|
protected XContentBuilder |
doXContentBody(XContentBuilder builder,
ToXContent.Params params) |
ExtendedBounds |
extendedBounds()
Return extended bounds for this histogram, or
null if none are set. |
DateHistogramAggregationBuilder |
extendedBounds(ExtendedBounds extendedBounds)
Set extended bounds on this histogram, so that buckets would also be
generated on intervals that did not match any documents.
|
java.lang.String |
getType()
The name of the type of aggregation built by this builder.
|
protected ValuesSourceAggregatorFactory<ValuesSource.Numeric,?> |
innerBuild(SearchContext context,
ValuesSourceConfig<ValuesSource.Numeric> config,
AggregatorFactory<?> parent,
AggregatorFactories.Builder subFactoriesBuilder) |
protected boolean |
innerEquals(java.lang.Object obj) |
protected int |
innerHashCode() |
protected void |
innerWriteTo(StreamOutput out)
Write subclass's state to the stream.
|
double |
interval()
Get the current interval in milliseconds that is set on this builder.
|
DateHistogramAggregationBuilder |
interval(long interval)
Set the interval on this builder, and return the builder so that calls can be chained.
|
boolean |
keyed()
Return whether buckets should be returned as a hash.
|
DateHistogramAggregationBuilder |
keyed(boolean keyed)
Set whether to return buckets as a hash or as an array, and return the
builder so that calls can be chained.
|
long |
minDocCount()
Return the minimum count of documents that buckets need to have in order
to be included in the response.
|
DateHistogramAggregationBuilder |
minDocCount(long minDocCount)
Set the minimum count of matching documents that buckets need to have
and return this builder so that calls can be chained.
|
double |
offset()
Get the offset to use when rounding, which is a number of milliseconds.
|
DateHistogramAggregationBuilder |
offset(long offset)
Set the offset on this builder, which is a number of milliseconds, and
return the builder so that calls can be chained.
|
DateHistogramAggregationBuilder |
offset(java.lang.String offset)
Set the offset on this builder, as a time value, and
return the builder so that calls can be chained.
|
Histogram.Order |
order()
Return the order to use to sort buckets of this histogram.
|
DateHistogramAggregationBuilder |
order(Histogram.Order order)
Set a new order on this builder and return the builder so that calls
can be chained.
|
static DateHistogramAggregationBuilder |
parse(java.lang.String aggregationName,
QueryParseContext context) |
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 static final java.util.Map<java.lang.String,DateTimeUnit> DATE_FIELD_UNITS
public DateHistogramAggregationBuilder(java.lang.String name)
public DateHistogramAggregationBuilder(StreamInput in) throws java.io.IOException
java.io.IOException
public static DateHistogramAggregationBuilder parse(java.lang.String aggregationName, QueryParseContext context) throws java.io.IOException
java.io.IOException
protected void innerWriteTo(StreamOutput out) throws java.io.IOException
ValuesSourceAggregationBuilder
innerWriteTo
in class ValuesSourceAggregationBuilder<ValuesSource.Numeric,DateHistogramAggregationBuilder>
java.io.IOException
public double interval()
public DateHistogramAggregationBuilder interval(long interval)
interval()
and dateHistogramInterval()
are set, then the
dateHistogramInterval()
wins.public DateHistogramInterval dateHistogramInterval()
public DateHistogramAggregationBuilder dateHistogramInterval(DateHistogramInterval dateHistogramInterval)
interval()
and dateHistogramInterval()
are set, then the
dateHistogramInterval()
wins.public double offset()
public DateHistogramAggregationBuilder offset(long offset)
public DateHistogramAggregationBuilder offset(java.lang.String offset)
public ExtendedBounds extendedBounds()
null
if none are set.public DateHistogramAggregationBuilder extendedBounds(ExtendedBounds extendedBounds)
public Histogram.Order order()
public DateHistogramAggregationBuilder order(Histogram.Order order)
public boolean keyed()
keyed
is false, buckets will be returned as an array.public DateHistogramAggregationBuilder keyed(boolean keyed)
public long minDocCount()
public DateHistogramAggregationBuilder minDocCount(long minDocCount)
protected XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
doXContentBody
in class ValuesSourceAggregationBuilder<ValuesSource.Numeric,DateHistogramAggregationBuilder>
java.io.IOException
public java.lang.String getType()
BaseAggregationBuilder
protected ValuesSourceAggregatorFactory<ValuesSource.Numeric,?> innerBuild(SearchContext context, ValuesSourceConfig<ValuesSource.Numeric> config, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder) throws java.io.IOException
innerBuild
in class ValuesSourceAggregationBuilder<ValuesSource.Numeric,DateHistogramAggregationBuilder>
java.io.IOException
protected int innerHashCode()
innerHashCode
in class ValuesSourceAggregationBuilder<ValuesSource.Numeric,DateHistogramAggregationBuilder>
protected boolean innerEquals(java.lang.Object obj)
innerEquals
in class ValuesSourceAggregationBuilder<ValuesSource.Numeric,DateHistogramAggregationBuilder>