Skip to main content

opensearch_client/common/query_dsl/
query_container.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 QueryContainer {
16    #[serde(rename = "nested", default, skip_serializing_if = "Option::is_none")]
17    pub nested: Option<String>,
18    #[serde(rename = "parent_id", default, skip_serializing_if = "Option::is_none")]
19    pub parent_id: Option<String>,
20    #[serde(
21        rename = "field_masking_span",
22        default,
23        skip_serializing_if = "Option::is_none"
24    )]
25    pub field_masking_span: Option<String>,
26    /// Analyzes the text and creates a phrase query out of the analyzed text.
27    #[serde(
28        rename = "match_phrase",
29        default,
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub match_phrase: Option<serde_json::Value>,
33    /// Returns documents based on the order and proximity of matching terms.
34    #[serde(rename = "intervals", default, skip_serializing_if = "Option::is_none")]
35    pub intervals: Option<serde_json::Value>,
36    #[serde(rename = "boosting", default, skip_serializing_if = "Option::is_none")]
37    pub boosting: Option<String>,
38    #[serde(rename = "percolate", default, skip_serializing_if = "Option::is_none")]
39    pub percolate: Option<String>,
40    #[serde(rename = "span_near", default, skip_serializing_if = "Option::is_none")]
41    pub span_near: Option<String>,
42    #[serde(rename = "span_not", default, skip_serializing_if = "Option::is_none")]
43    pub span_not: Option<String>,
44    #[serde(
45        rename = "geo_bounding_box",
46        default,
47        skip_serializing_if = "Option::is_none"
48    )]
49    pub geo_bounding_box: Option<String>,
50    /// Analyzes its input and constructs a `bool` query from the terms.
51    /// Each term except the last is used in a `term` query.
52    /// The last term is used in a prefix query.
53    #[serde(
54        rename = "match_bool_prefix",
55        default,
56        skip_serializing_if = "Option::is_none"
57    )]
58    pub match_bool_prefix: Option<serde_json::Value>,
59    /// Returns documents that contain a specific prefix in a provided field.
60    #[serde(rename = "prefix", default, skip_serializing_if = "Option::is_none")]
61    pub prefix: Option<serde_json::Value>,
62    #[serde(
63        rename = "more_like_this",
64        default,
65        skip_serializing_if = "Option::is_none"
66    )]
67    pub more_like_this: Option<String>,
68    #[serde(
69        rename = "span_multi",
70        default,
71        skip_serializing_if = "Option::is_none"
72    )]
73    pub span_multi: Option<String>,
74    #[serde(rename = "common", default, skip_serializing_if = "Option::is_none")]
75    pub common: Option<serde_json::Value>,
76    #[serde(
77        rename = "span_within",
78        default,
79        skip_serializing_if = "Option::is_none"
80    )]
81    pub span_within: Option<String>,
82    #[serde(rename = "ids", default, skip_serializing_if = "Option::is_none")]
83    pub ids: Option<String>,
84    #[serde(
85        rename = "distance_feature",
86        default,
87        skip_serializing_if = "Option::is_none"
88    )]
89    pub distance_feature: Option<String>,
90    #[serde(
91        rename = "geo_polygon",
92        default,
93        skip_serializing_if = "Option::is_none"
94    )]
95    pub geo_polygon: Option<String>,
96    #[serde(rename = "match_all", default, skip_serializing_if = "Option::is_none")]
97    pub match_all: Option<String>,
98    /// Returns documents that contain terms within a provided range.
99    #[serde(rename = "range", default, skip_serializing_if = "Option::is_none")]
100    pub range: Option<serde_json::Value>,
101    #[serde(
102        rename = "combined_fields",
103        default,
104        skip_serializing_if = "Option::is_none"
105    )]
106    pub combined_fields: Option<String>,
107    /// Returns documents that contain terms similar to the search term, as measured by a Levenshtein edit distance.
108    #[serde(rename = "fuzzy", default, skip_serializing_if = "Option::is_none")]
109    pub fuzzy: Option<serde_json::Value>,
110    /// Returns documents that contain the words of a provided text, in the same order as provided.
111    /// The last term of the provided text is treated as a prefix, matching any words that begin with that term.
112    #[serde(
113        rename = "match_phrase_prefix",
114        default,
115        skip_serializing_if = "Option::is_none"
116    )]
117    pub match_phrase_prefix: Option<serde_json::Value>,
118    #[serde(
119        rename = "function_score",
120        default,
121        skip_serializing_if = "Option::is_none"
122    )]
123    pub function_score: Option<String>,
124    #[serde(rename = "geo_shape", default, skip_serializing_if = "Option::is_none")]
125    pub geo_shape: Option<String>,
126    #[serde(
127        rename = "constant_score",
128        default,
129        skip_serializing_if = "Option::is_none"
130    )]
131    pub constant_score: Option<String>,
132    #[serde(rename = "hybrid", default, skip_serializing_if = "Option::is_none")]
133    pub hybrid: Option<String>,
134    #[serde(
135        rename = "multi_match",
136        default,
137        skip_serializing_if = "Option::is_none"
138    )]
139    pub multi_match: Option<String>,
140    #[serde(rename = "pinned", default, skip_serializing_if = "Option::is_none")]
141    pub pinned: Option<String>,
142    #[serde(
143        rename = "rank_feature",
144        default,
145        skip_serializing_if = "Option::is_none"
146    )]
147    pub rank_feature: Option<String>,
148    #[serde(rename = "neural", default, skip_serializing_if = "Option::is_none")]
149    pub neural: Option<serde_json::Value>,
150    #[serde(rename = "script", default, skip_serializing_if = "Option::is_none")]
151    pub script: Option<String>,
152    #[serde(
153        rename = "script_score",
154        default,
155        skip_serializing_if = "Option::is_none"
156    )]
157    pub script_score: Option<String>,
158    #[serde(
159        rename = "has_parent",
160        default,
161        skip_serializing_if = "Option::is_none"
162    )]
163    pub has_parent: Option<String>,
164    #[serde(
165        rename = "geo_distance",
166        default,
167        skip_serializing_if = "Option::is_none"
168    )]
169    pub geo_distance: Option<String>,
170    #[serde(
171        rename = "span_containing",
172        default,
173        skip_serializing_if = "Option::is_none"
174    )]
175    pub span_containing: Option<String>,
176    /// Returns documents that contain terms matching a regular expression.
177    #[serde(rename = "regexp", default, skip_serializing_if = "Option::is_none")]
178    pub regexp: Option<serde_json::Value>,
179    /// Matches spans containing a term.
180    #[serde(rename = "span_term", default, skip_serializing_if = "Option::is_none")]
181    pub span_term: Option<serde_json::Value>,
182    #[serde(rename = "terms", default, skip_serializing_if = "Option::is_none")]
183    pub terms: Option<String>,
184    /// Returns documents that contain terms matching a wildcard pattern.
185    #[serde(rename = "wildcard", default, skip_serializing_if = "Option::is_none")]
186    pub wildcard: Option<serde_json::Value>,
187    #[serde(rename = "wrapper", default, skip_serializing_if = "Option::is_none")]
188    pub wrapper: Option<String>,
189    #[serde(rename = "exists", default, skip_serializing_if = "Option::is_none")]
190    pub exists: Option<String>,
191    #[serde(
192        rename = "simple_query_string",
193        default,
194        skip_serializing_if = "Option::is_none"
195    )]
196    pub simple_query_string: Option<String>,
197    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
198    pub r#type: Option<String>,
199    /// Returns documents that contain an exact term in a provided field.
200    /// To return a document, the query term must exactly match the queried field's value, including white space and capitalization.
201    #[serde(rename = "term", default, skip_serializing_if = "Option::is_none")]
202    pub term: Option<serde_json::Value>,
203    #[serde(
204        rename = "match_none",
205        default,
206        skip_serializing_if = "Option::is_none"
207    )]
208    pub match_none: Option<String>,
209    #[serde(
210        rename = "query_string",
211        default,
212        skip_serializing_if = "Option::is_none"
213    )]
214    pub query_string: Option<String>,
215    #[serde(rename = "dis_max", default, skip_serializing_if = "Option::is_none")]
216    pub dis_max: Option<String>,
217    #[serde(
218        rename = "span_first",
219        default,
220        skip_serializing_if = "Option::is_none"
221    )]
222    pub span_first: Option<String>,
223    #[serde(rename = "span_or", default, skip_serializing_if = "Option::is_none")]
224    pub span_or: Option<String>,
225    #[serde(rename = "has_child", default, skip_serializing_if = "Option::is_none")]
226    pub has_child: Option<String>,
227    /// Returns documents that contain a minimum number of exact terms in a provided field.
228    /// To return a document, a required number of terms must exactly match the field values, including white space and capitalization.
229    #[serde(rename = "terms_set", default, skip_serializing_if = "Option::is_none")]
230    pub terms_set: Option<serde_json::Value>,
231    #[serde(rename = "knn", default, skip_serializing_if = "Option::is_none")]
232    pub knn: Option<serde_json::Value>,
233    /// Returns documents that match a provided text, number, date or Boolean value.
234    /// The provided text is analyzed before matching.
235    #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
236    pub r#match: Option<serde_json::Value>,
237    #[serde(rename = "bool", default, skip_serializing_if = "Option::is_none")]
238    pub bool: Option<String>,
239}
240
241impl QueryContainer {
242    pub fn new() -> QueryContainer {
243        QueryContainer {
244            nested: None,
245            parent_id: None,
246            field_masking_span: None,
247            match_phrase: None,
248            intervals: None,
249            boosting: None,
250            percolate: None,
251            span_near: None,
252            span_not: None,
253            geo_bounding_box: None,
254            match_bool_prefix: None,
255            prefix: None,
256            more_like_this: None,
257            span_multi: None,
258            common: None,
259            span_within: None,
260            ids: None,
261            distance_feature: None,
262            geo_polygon: None,
263            match_all: None,
264            range: None,
265            combined_fields: None,
266            fuzzy: None,
267            match_phrase_prefix: None,
268            function_score: None,
269            geo_shape: None,
270            constant_score: None,
271            hybrid: None,
272            multi_match: None,
273            pinned: None,
274            rank_feature: None,
275            neural: None,
276            script: None,
277            script_score: None,
278            has_parent: None,
279            geo_distance: None,
280            span_containing: None,
281            regexp: None,
282            span_term: None,
283            terms: None,
284            wildcard: None,
285            wrapper: None,
286            exists: None,
287            simple_query_string: None,
288            r#type: None,
289            term: None,
290            match_none: None,
291            query_string: None,
292            dis_max: None,
293            span_first: None,
294            span_or: None,
295            has_child: None,
296            terms_set: None,
297            knn: None,
298            r#match: None,
299            bool: None,
300        }
301    }
302}