manticore_openapi/models/
facet.rs

1/*
2 * Manticore Search Client
3 *
4 * Сlient for Manticore Search. 
5 *
6 * The version of the OpenAPI document: 3.3.1
7 * Contact: info@manticoresearch.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Facet : Query FACET expression
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Facet {
17    /// The name of an attribute to facet
18    #[serde(rename = "attr")]
19    pub attr: String,
20    /// Facet alias
21    #[serde(rename = "alias", skip_serializing_if = "Option::is_none")]
22    pub alias: Option<String>,
23    /// The number of facet values to return
24    #[serde(rename = "limit", skip_serializing_if = "Option::is_none")]
25    pub limit: Option<i32>,
26}
27
28impl Facet {
29    /// Query FACET expression
30    pub fn new(attr: String) -> Facet {
31        Facet {
32            attr,
33            alias: None,
34            limit: None,
35        }
36    }
37}
38