pub struct DateHistogramAggregation {
pub field: String,
pub calendar_interval: Option<CalendarInterval>,
pub fixed_interval: Option<String>,
pub time_zone: Option<String>,
pub offset: Option<String>,
pub format: Option<String>,
pub missing: Option<String>,
}
Expand description
This multi-bucket aggregation is similar to the normal histogram, but it can only be used with date or date range values.
Note: until GraphQL Union input types are supported, either
calendarInterval
or fixedInterval
must be specified but not both.
Fields§
§field: String
The field to perform the aggregation over.
calendar_interval: Option<CalendarInterval>
Calendar-aware intervals understand that daylight savings changes the length of specific days, months have different amounts of days, and leap seconds can be tacked onto a particular year.
fixed_interval: Option<String>
In contrast to calendar-aware intervals, fixed intervals are a fixed
number of SI units and never deviate, regardless of where they fall on
the calendar. One second is always composed of 1000ms
. This allows
fixed intervals to be specified in any multiple of the supported units.
time_zone: Option<String>
Indicates that bucketing and rounding should use a different timezone than the default UTC.
Accepts either an ISO 8601 UTC offset (e.g. +01:00
or -08:00
) or as
a timezone ID as specified in the IANA timezone database, such as
America/Los_Angeles
.
offset: Option<String>
Changes the start value of each bucket by the specified positive (+
)
or negative offset (-
) duration, such as 1h
for an hour, or 1d
for
a day. See Time units for more possible time duration options.
Note: The start offset
of each bucket is calculated after
timeZone
adjustments have been made.
format: Option<String>
How the returned date should be formatted.
missing: Option<String>
Defines how documents that are missing a value should be treated. By default they will be ignored but it is also possible to treat them as if they had a value.
Implementations§
Source§impl DateHistogramAggregation
impl DateHistogramAggregation
Sourcepub fn builder() -> DateHistogramAggregationBuilder<((), (), (), (), (), (), ())>
pub fn builder() -> DateHistogramAggregationBuilder<((), (), (), (), (), (), ())>
Create a builder for building DateHistogramAggregation
.
On the builder, call .field(...)
, .calendar_interval(...)
(optional), .fixed_interval(...)
(optional), .time_zone(...)
(optional), .offset(...)
(optional), .format(...)
(optional), .missing(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of DateHistogramAggregation
.
Trait Implementations§
Source§impl Clone for DateHistogramAggregation
impl Clone for DateHistogramAggregation
Source§fn clone(&self) -> DateHistogramAggregation
fn clone(&self) -> DateHistogramAggregation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more