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
15
16
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
18pub struct FieldCapability {  /// Whether this field can be aggregated on all indexes.
19    #[serde(rename = "aggregatable")]
20    pub aggregatable: bool,  /// A comma-separated list of data streams, indexes, and aliases used to limit the request.
21  /// Supports wildcards (`*`).
22  /// To target all data streams and indexes, omit this parameter or use `*` or `_all`.
23    #[serde(rename = "non_searchable_indices", default, skip_serializing_if = "Option::is_none")]
24    pub non_searchable_indices: Option<common::Indices>,  /// A comma-separated list of data streams, indexes, and aliases used to limit the request.
25  /// Supports wildcards (`*`).
26  /// To target all data streams and indexes, omit this parameter or use `*` or `_all`.
27    #[serde(rename = "indices", default, skip_serializing_if = "Option::is_none")]
28    pub indices: Option<common::Indices>,  /// Whether this field is indexed for search on all indexes.
29    #[serde(rename = "searchable")]
30    pub searchable: bool,  /// Whether this field is registered as a metadata field.
31    #[serde(rename = "metadata_field", default, skip_serializing_if = "Option::is_none")]
32    pub metadata_field: Option<bool>,
33    #[serde(rename = "type")]
34    pub r#type: String,
35    #[serde(rename = "meta", default, skip_serializing_if = "Option::is_none")]
36    pub meta: Option<serde_json::Value>,  /// A comma-separated list of data streams, indexes, and aliases used to limit the request.
37  /// Supports wildcards (`*`).
38  /// To target all data streams and indexes, omit this parameter or use `*` or `_all`.
39    #[serde(rename = "non_aggregatable_indices", default, skip_serializing_if = "Option::is_none")]
40    pub non_aggregatable_indices: Option<common::Indices>,
41}
42
43impl FieldCapability {
44    
45    pub fn new(aggregatable: bool, searchable: bool, r#type: String) -> FieldCapability {
46        FieldCapability {
47            aggregatable,
48            non_searchable_indices: None,
49            indices: None,
50            searchable,
51            metadata_field: None,
52            r#type,
53            meta: None,
54            non_aggregatable_indices: None,
55        }
56    }
57}