Skip to main content

opensearch_client/ml/
bool_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/// BoolQuery
15/// The Boolean query.
16
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
18pub struct BoolQuery {
19    /// The filter element.
20    #[serde(rename = "must_not", default, skip_serializing_if = "Option::is_none")]
21    pub must_not: Option<Box<ml::Filter>>,
22    /// Query that should appear in matching documents.
23    #[serde(rename = "should", default, skip_serializing_if = "Option::is_none")]
24    pub should: Option<Vec<ml::Filter>>,
25    /// Query that must appears in matching documents
26    #[serde(rename = "must", default, skip_serializing_if = "Option::is_none")]
27    pub must: Option<Vec<ml::Filter>>,
28    /// Filter query that appears in matching documents.
29    #[serde(rename = "filter", default, skip_serializing_if = "Option::is_none")]
30    pub filter: Option<Vec<ml::Filter>>,
31}
32
33impl BoolQuery {
34    /// The Boolean query.
35    pub fn new() -> BoolQuery {
36        BoolQuery {
37            must_not: None,
38            should: None,
39            must: None,
40            filter: None,
41        }
42    }
43}