Skip to main content

opensearch_client/core/field_caps/
field_capability.rs

1/*
2 * opensearch-client
3 *
4 * Rust Client for OpenSearch
5 *
6 * The version of the OpenAPI document: 3.1.0
7 * Contact: alberto.paro@gmail.com
8 * Generated by Paro OpenAPI Generator
9 */
10
11use crate::common;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct FieldCapability {
16    /// Whether this field can be aggregated on all indexes.
17    #[serde(rename = "aggregatable")]
18    pub aggregatable: bool,
19    /// A comma-separated list of data streams, indexes, and aliases used to limit the request.
20    /// Supports wildcards (`*`).
21    /// To target all data streams and indexes, omit this parameter or use `*` or `_all`.
22    #[serde(
23        rename = "non_searchable_indices",
24        default,
25        skip_serializing_if = "Option::is_none"
26    )]
27    pub non_searchable_indices: Option<common::Indices>,
28    /// A comma-separated list of data streams, indexes, and aliases used to limit the request.
29    /// Supports wildcards (`*`).
30    /// To target all data streams and indexes, omit this parameter or use `*` or `_all`.
31    #[serde(rename = "indices", default, skip_serializing_if = "Option::is_none")]
32    pub indices: Option<common::Indices>,
33    /// Whether this field is indexed for search on all indexes.
34    #[serde(rename = "searchable")]
35    pub searchable: bool,
36    /// Whether this field is registered as a metadata field.
37    #[serde(
38        rename = "metadata_field",
39        default,
40        skip_serializing_if = "Option::is_none"
41    )]
42    pub metadata_field: Option<bool>,
43    #[serde(rename = "type")]
44    pub r#type: String,
45    #[serde(rename = "meta", default, skip_serializing_if = "Option::is_none")]
46    pub meta: Option<serde_json::Value>,
47    /// A comma-separated list of data streams, indexes, and aliases used to limit the request.
48    /// Supports wildcards (`*`).
49    /// To target all data streams and indexes, omit this parameter or use `*` or `_all`.
50    #[serde(
51        rename = "non_aggregatable_indices",
52        default,
53        skip_serializing_if = "Option::is_none"
54    )]
55    pub non_aggregatable_indices: Option<common::Indices>,
56}
57
58impl FieldCapability {
59    pub fn new(aggregatable: bool, searchable: bool, r#type: String) -> FieldCapability {
60        FieldCapability {
61            aggregatable,
62            non_searchable_indices: None,
63            indices: None,
64            searchable,
65            metadata_field: None,
66            r#type,
67            meta: None,
68            non_aggregatable_indices: None,
69        }
70    }
71}