Struct DateHistogramAggregation

Source
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

Source

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

Source§

fn clone(&self) -> DateHistogramAggregation

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DateHistogramAggregation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DateHistogramAggregation

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for DateHistogramAggregation

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,