opensearch-client 0.3.1

Strongly typed OpenSearch Client
Documentation
/*
 * opensearch-client
 *
 * Rust Client for OpenSearch
 *
 * The version of the OpenAPI document: 3.1.0
 * Contact: alberto.paro@gmail.com
 * Generated by Paro OpenAPI Generator
 */

use crate::common;
use crate::core;
pub use opensearch_dsl::Search;
use serde::{Deserialize, Serialize};

// /// Search
// /// The search definition using the Query DSL
// #[cfg(not(feature = "search"))]
// #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
// pub struct Search {
//     /// Boosts the `_score` of documents from specified indexes.
//     #[serde(
//         rename = "indices_boost",
//         default,
//         skip_serializing_if = "Option::is_none"
//     )]
//     pub indices_boost: Option<Vec<serde_json::Value>>,
//     /// Retrieve a script evaluation (based on different fields) for each hit.
//     #[serde(
//         rename = "script_fields",
//         default,
//         skip_serializing_if = "Option::is_none"
//     )]
//     pub script_fields: Option<serde_json::Value>,
//     /// Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.
//     #[serde(rename = "_source", default, skip_serializing_if = "Option::is_none")]
//     pub source: Option<core::search::SourceConfig>,
//     /// If `true`, returns detailed information about score computation as part of a hit.
//     #[serde(rename = "explain", default, skip_serializing_if = "Option::is_none")]
//     pub explain: Option<bool>,
//     #[serde(rename = "collapse", default, skip_serializing_if = "Option::is_none")]
//     pub collapse: Option<core::search::FieldCollapse>,
//     /// Configuration of search extensions defined by OpenSearch plugins.
//     #[serde(rename = "ext", default, skip_serializing_if = "Option::is_none")]
//     pub ext: Option<serde_json::Value>,
//     /// Array of wildcard (`*`) patterns.
//     /// The request returns doc values for field names matching these patterns in the `hits.fields` property of the response.
//     #[serde(
//         rename = "docvalue_fields",
//         default,
//         skip_serializing_if = "Option::is_none"
//     )]
//     pub docvalue_fields: Option<Vec<common::query_dsl::FieldAndFormat>>,
//     /// Defines the aggregations that are run as part of the search request.
//     #[serde(
//         rename = "aggregations",
//         default,
//         skip_serializing_if = "Option::is_none"
//     )]
//     pub aggregations: Option<serde_json::Value>,
//     /// Starting document offset.
//     /// Needs to be non-negative.
//     /// By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.
//     /// To page through more hits, use the `search_after` parameter.
//     #[serde(rename = "from", default, skip_serializing_if = "Option::is_none")]
//     pub from: Option<u32>,
//     /// Stats groups to associate with the search.
//     /// Each group maintains a statistics aggregation for its associated searches.
//     /// You can retrieve these stats using the indexes stats API.
//     #[serde(rename = "stats", default, skip_serializing_if = "Option::is_none")]
//     pub stats: Option<Vec<String>>,
//     /// If `true`, calculate and return document scores, even if the scores are not used for sorting.
//     #[serde(
//         rename = "track_scores",
//         default,
//         skip_serializing_if = "Option::is_none"
//     )]
//     pub track_scores: Option<bool>,
//     #[serde(
//         rename = "post_filter",
//         default,
//         skip_serializing_if = "Option::is_none"
//     )]
//     pub post_filter: Option<crate::dsl::Query>,
//     #[serde(rename = "slice", default, skip_serializing_if = "Option::is_none")]
//     pub slice: Option<common::SlicedScroll>,
//     /// Array of wildcard (`*`) patterns.
//     /// The request returns values for field names matching these patterns in the `hits.fields` property of the response.
//     #[serde(rename = "fields", default, skip_serializing_if = "Option::is_none")]
//     pub fields: Option<Vec<common::query_dsl::FieldAndFormat>>,
//     /// Specifies the period of time to wait for a response from each shard.
//     /// If no response is received before the timeout expires, the request fails and returns an error.
//     /// Defaults to no timeout.
//     #[serde(rename = "timeout", default, skip_serializing_if = "Option::is_none")]
//     pub timeout: Option<String>,
//     /// The number of hits to return.
//     /// By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.
//     /// To page through more hits, use the `search_after` parameter.
//     #[serde(rename = "size", default, skip_serializing_if = "Option::is_none")]
//     pub size: Option<u32>,
//     #[serde(rename = "query", default, skip_serializing_if = "Option::is_none")]
//     pub query: Option<crate::dsl::Query>,
//     #[serde(rename = "rank", default, skip_serializing_if = "Option::is_none")]
//     pub rank: Option<common::RankContainer>,
//     #[serde(rename = "suggest", default, skip_serializing_if = "Option::is_none")]
//     pub suggest: Option<core::search::Suggester>,
//     /// Maximum number of documents to collect for each shard.
//     /// If a query reaches this limit, OpenSearch terminates the query early.
//     /// OpenSearch collects documents before sorting.
//     /// Use with caution.
//     /// OpenSearch applies this parameter to each shard handling the request.
//     /// When possible, let OpenSearch perform early termination automatically.
//     /// Avoid specifying this parameter for requests that target data streams with backing indexes across multiple data tiers.
//     /// If set to `0` (default), the query does not terminate early.
//     #[serde(
//         rename = "terminate_after",
//         default,
//         skip_serializing_if = "Option::is_none"
//     )]
//     pub terminate_after: Option<u32>,
//     #[serde(rename = "highlight", default, skip_serializing_if = "Option::is_none")]
//     pub highlight: Option<String>,
//     #[serde(rename = "sort", default, skip_serializing_if = "Option::is_none")]
//     pub sort: Option<common::Sort>,
//     #[serde(rename = "pit", default, skip_serializing_if = "Option::is_none")]
//     pub pit: Option<core::search::PointInTimeReference>,
//     /// If `true`, returns sequence number and primary term of the last modification of each hit.
//     #[serde(
//         rename = "seq_no_primary_term",
//         default,
//         skip_serializing_if = "Option::is_none"
//     )]
//     pub seq_no_primary_term: Option<bool>,
//     /// If `true`, returns document version as part of a hit.
//     #[serde(rename = "version", default, skip_serializing_if = "Option::is_none")]
//     pub version: Option<bool>,
//     #[serde(
//         rename = "stored_fields",
//         default,
//         skip_serializing_if = "Option::is_none"
//     )]
//     pub stored_fields: Option<common::Fields>,
//     /// The number of hits matching the query. When `true`, the exact
//     /// number of hits is returned at the cost of some performance. When `false`, the
//     /// response does not include the total number of hits matching the query.
//     /// Default is `10,000` hits.
//     #[serde(
//         rename = "track_total_hits",
//         default,
//         skip_serializing_if = "Option::is_none"
//     )]
//     pub track_total_hits: Option<bool>,
//     /// Set to `true` to return detailed timing information about the execution of individual components in a search request.
//     /// NOTE: This is a debugging tool and adds significant overhead to search execution.
//     #[serde(rename = "profile", default, skip_serializing_if = "Option::is_none")]
//     pub profile: Option<bool>,
//     /// Minimum `_score` for matching documents.
//     /// Documents with a lower `_score` are not included in the search results.
//     #[serde(rename = "min_score", default, skip_serializing_if = "Option::is_none")]
//     pub min_score: Option<f64>,
//     /// Defines the aggregations that are run as part of the search request.
//     #[serde(rename = "aggs", default, skip_serializing_if = "Option::is_none")]
//     pub aggs: Option<serde_json::Value>,
// }

// #[cfg(not(feature = "search"))]
// impl Search {
//     /// The search definition using the Query DSL
//     pub fn new() -> Search {
//         Search {
//             indices_boost: None,
//             script_fields: None,
//             source: None,
//             explain: None,
//             collapse: None,
//             ext: None,
//             docvalue_fields: None,
//             aggregations: None,
//             from: None,
//             stats: None,
//             track_scores: None,
//             post_filter: None,
//             slice: None,
//             fields: None,
//             timeout: None,
//             size: None,
//             query: None,
//             rank: None,
//             suggest: None,
//             terminate_after: None,
//             highlight: None,
//             sort: None,
//             pit: None,
//             seq_no_primary_term: None,
//             version: None,
//             stored_fields: None,
//             track_total_hits: None,
//             profile: None,
//             min_score: None,
//             aggs: None,
//         }
//     }
// }