Struct elastiql::aggregation::types::DateHistogramAggregation[][src]

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

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.