1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* Manticore Search Client
*
* Сlient for Manticore Search.
*
* The version of the OpenAPI document: 5.0.0
* Contact: info@manticoresearch.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// AggHistogram : Object to use histograms in aggregation, i.e., grouping search results by histogram values
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AggHistogram {
/// Field to group by
#[serde(rename = "field")]
pub field: String,
/// Interval of the histogram values
#[serde(rename = "interval")]
pub interval: i32,
/// Offset of the histogram values. Default value is 0.
#[serde(rename = "offset", skip_serializing_if = "Option::is_none")]
pub offset: Option<i32>,
/// Flag that defines if a search response will be a dictionary with the bucket keys. Default value is false.
#[serde(rename = "keyed", skip_serializing_if = "Option::is_none")]
pub keyed: Option<bool>,
}
impl AggHistogram {
/// Object to use histograms in aggregation, i.e., grouping search results by histogram values
pub fn new(field: String, interval: i32) -> AggHistogram {
AggHistogram {
field,
interval,
offset: None,
keyed: None,
}
}
}