Class DateHistogramAggregation.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<BuilderT>
co.elastic.clients.elasticsearch._types.aggregations.AggregationBase.AbstractBuilder<BuilderT>
co.elastic.clients.elasticsearch._types.aggregations.BucketAggregationBase.AbstractBuilder<DateHistogramAggregation.Builder>
co.elastic.clients.elasticsearch._types.aggregations.DateHistogramAggregation.Builder
- All Implemented Interfaces:
WithJson<DateHistogramAggregation.Builder>
,ObjectBuilder<DateHistogramAggregation>
- Enclosing class:
- DateHistogramAggregation
public static class DateHistogramAggregation.Builder
extends BucketAggregationBase.AbstractBuilder<DateHistogramAggregation.Builder>
implements ObjectBuilder<DateHistogramAggregation>
Builder for
DateHistogramAggregation
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aDateHistogramAggregation
.calendarInterval
(CalendarInterval value) Calendar-aware interval.Enables extending the bounds of the histogram beyond the data itself.extendedBounds
(Function<ExtendedBounds.Builder<FieldDateMath>, ObjectBuilder<ExtendedBounds<FieldDateMath>>> fn) Enables extending the bounds of the histogram beyond the data itself.The date field whose values are use to build a histogram.fixedInterval
(Time value) Fixed intervals: a fixed number of SI units and never deviate, regardless of where they fall on the calendar.Fixed intervals: a fixed number of SI units and never deviate, regardless of where they fall on the calendar.The date format used to formatkey_as_string
in the response.hardBounds
(ExtendedBounds<FieldDateMath> value) Limits the histogram to specified bounds.hardBounds
(Function<ExtendedBounds.Builder<FieldDateMath>, ObjectBuilder<ExtendedBounds<FieldDateMath>>> fn) Limits the histogram to specified bounds.Deprecated.Deprecated.7.2.0 usefixed_interval
orcalendar_interval
Set totrue
to associate a unique string key with each bucket and return the ranges as a hash rather than an array.minDocCount
(Integer value) Only returns buckets that havemin_doc_count
number of documents.The value to apply to documents that do not have a value.Changes the start value of each bucket by the specified positive (+
) or negative offset (-
) duration.Changes the start value of each bucket by the specified positive (+
) or negative offset (-
) duration.order
(NamedValue<SortOrder> value, NamedValue<SortOrder>... values) The sort order of the returned buckets.order
(List<NamedValue<SortOrder>> list) The sort order of the returned buckets.API name:params
API name:params
API name:script
API name:script
protected DateHistogramAggregation.Builder
self()
Time zone used for bucketing and rounding.Methods inherited from class co.elastic.clients.elasticsearch._types.aggregations.AggregationBase.AbstractBuilder
meta, meta, name
Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJson
Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
calendarInterval
Calendar-aware interval. Can be specified using the unit name, such asmonth
, or as a single unit quantity, such as1M
.API name:
calendar_interval
-
extendedBounds
public final DateHistogramAggregation.Builder extendedBounds(@Nullable ExtendedBounds<FieldDateMath> value) Enables extending the bounds of the histogram beyond the data itself.API name:
extended_bounds
-
extendedBounds
public final DateHistogramAggregation.Builder extendedBounds(Function<ExtendedBounds.Builder<FieldDateMath>, ObjectBuilder<ExtendedBounds<FieldDateMath>>> fn) Enables extending the bounds of the histogram beyond the data itself.API name:
extended_bounds
-
hardBounds
public final DateHistogramAggregation.Builder hardBounds(@Nullable ExtendedBounds<FieldDateMath> value) Limits the histogram to specified bounds.API name:
hard_bounds
-
hardBounds
public final DateHistogramAggregation.Builder hardBounds(Function<ExtendedBounds.Builder<FieldDateMath>, ObjectBuilder<ExtendedBounds<FieldDateMath>>> fn) Limits the histogram to specified bounds.API name:
hard_bounds
-
field
The date field whose values are use to build a histogram.API name:
field
-
fixedInterval
Fixed intervals: a fixed number of SI units and never deviate, regardless of where they fall on the calendar.API name:
fixed_interval
-
fixedInterval
public final DateHistogramAggregation.Builder fixedInterval(Function<Time.Builder, ObjectBuilder<Time>> fn) Fixed intervals: a fixed number of SI units and never deviate, regardless of where they fall on the calendar.API name:
fixed_interval
-
format
The date format used to formatkey_as_string
in the response. If noformat
is specified, the first date format specified in the field mapping is used.API name:
format
-
interval
Deprecated.7.2.0 usefixed_interval
orcalendar_interval
API name:interval
-
interval
@Deprecated public final DateHistogramAggregation.Builder interval(Function<Time.Builder, ObjectBuilder<Time>> fn) Deprecated.7.2.0 usefixed_interval
orcalendar_interval
API name:interval
-
minDocCount
Only returns buckets that havemin_doc_count
number of documents. By default, all buckets between the first bucket that matches documents and the last one are returned.API name:
min_doc_count
-
missing
The value to apply to documents that do not have a value. By default, documents without a value are ignored.API name:
missing
-
offset
Changes the start value of each bucket by the specified positive (+
) or negative offset (-
) duration.API name:
offset
-
offset
Changes the start value of each bucket by the specified positive (+
) or negative offset (-
) duration.API name:
offset
-
order
The sort order of the returned buckets.API name:
order
Adds all elements of
list
toorder
. -
order
public final DateHistogramAggregation.Builder order(NamedValue<SortOrder> value, NamedValue<SortOrder>... values) The sort order of the returned buckets.API name:
order
Adds one or more values to
order
. -
params
API name:params
Adds all entries of
map
toparams
. -
params
API name:params
Adds an entry to
params
. -
script
API name:script
-
script
public final DateHistogramAggregation.Builder script(Function<Script.Builder, ObjectBuilder<Script>> fn) API name:script
-
timeZone
Time zone used for bucketing and rounding. Defaults to Coordinated Universal Time (UTC).API name:
time_zone
-
keyed
Set totrue
to associate a unique string key with each bucket and return the ranges as a hash rather than an array.API name:
keyed
-
self
- Specified by:
self
in classAggregationBase.AbstractBuilder<DateHistogramAggregation.Builder>
-
build
Builds aDateHistogramAggregation
.- Specified by:
build
in interfaceObjectBuilder<DateHistogramAggregation>
- Throws:
NullPointerException
- if some of the required fields are null.
-
fixed_interval
orcalendar_interval