manticoresearch 2.0.0

Сlient for Manticore Search.
Documentation
/*
 * 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,
        }
    }
}