Skip to main content

opensearch_client/ml/
query.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::ml;
12use serde::{Deserialize, Serialize};
13
14/// Query
15/// The query.
16
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
18pub struct Query {
19    /// The match all query.
20    #[serde(rename = "match_all", default, skip_serializing_if = "Option::is_none")]
21    pub match_all: Option<ml::MatchAllQuery>,
22    /// The Boolean query.
23    #[serde(rename = "bool", default, skip_serializing_if = "Option::is_none")]
24    pub bool: Option<ml::BoolQuery>,
25    /// Term to match the query.
26    #[serde(rename = "term", default, skip_serializing_if = "Option::is_none")]
27    pub term: Option<ml::Term>,
28    /// Match query.
29    #[serde(rename = "match", default, skip_serializing_if = "Option::is_none")]
30    pub r#match: Option<ml::Match>,
31}
32
33impl Query {
34    /// The query.
35    pub fn new() -> Query {
36        Query {
37            match_all: None,
38            bool: None,
39            term: None,
40            r#match: None,
41        }
42    }
43}