1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/*
* 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;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct MultisearchBody {
/// When `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 = "stored_fields",
default,
skip_serializing_if = "Option::is_none"
)]
pub stored_fields: Option<common::Fields>,
#[serde(rename = "profile", default, skip_serializing_if = "Option::is_none")]
pub profile: Option<bool>,
#[serde(rename = "suggest", default, skip_serializing_if = "Option::is_none")]
pub suggest: Option<core::search::Suggester>,
/// When `true`, calculates and returns all 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 = "aggregations",
default,
skip_serializing_if = "Option::is_none"
)]
pub aggregations: Option<serde_json::Value>,
/// 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<f64>,
/// 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>,
/// The minimum `_score` for document matching. Documents with a lower `_score` than the minimum
/// are not included in the search results.
#[serde(rename = "min_score", default, skip_serializing_if = "Option::is_none")]
pub min_score: Option<f64>,
/// The statistics groups to associate with the search. Each group maintains a statistics
/// aggregation for its associated searches. You can retrieve these statistics using
/// the Index Stats API.
#[serde(rename = "stats", default, skip_serializing_if = "Option::is_none")]
pub stats: Option<Vec<String>>,
/// When `true`, returns the document version as part of the hit.
#[serde(rename = "version", default, skip_serializing_if = "Option::is_none")]
pub version: Option<bool>,
#[serde(rename = "sort", default, skip_serializing_if = "Option::is_none")]
pub sort: Option<common::Sort>,
/// The starting document offset. By default, you cannot page through more than 10,000
/// hits using the `from` and `size` parameters. To page through more than 10,000 hits, use the
/// `search_after` parameter.
#[serde(rename = "from", default, skip_serializing_if = "Option::is_none")]
pub from: Option<f64>,
/// 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>,
#[serde(
rename = "post_filter",
default,
skip_serializing_if = "Option::is_none"
)]
pub post_filter: Option<crate::dsl::Query>,
#[serde(rename = "highlight", default, skip_serializing_if = "Option::is_none")]
pub highlight: Option<String>,
#[serde(rename = "collapse", default, skip_serializing_if = "Option::is_none")]
pub collapse: Option<core::search::FieldCollapse>,
#[serde(rename = "query", default, skip_serializing_if = "Option::is_none")]
pub query: Option<crate::dsl::Query>,
/// When `true`, returns the sequence number and primary term of the last modification.
/// of each hit. See Optimistic concurrency control.
#[serde(
rename = "seq_no_primary_term",
default,
skip_serializing_if = "Option::is_none"
)]
pub seq_no_primary_term: Option<bool>,
/// An array of wildcard (*) patterns. The request returns document 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>>,
/// Retrieves 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>,
/// The maximum number of documents to collect for each shard. If a query reaches this
/// limit, OpenSearch stops the query early. OpenSearch collects documents
/// before sorting. Default is `0`, which does not terminate query execution early.
#[serde(
rename = "terminate_after",
default,
skip_serializing_if = "Option::is_none"
)]
pub terminate_after: Option<f64>,
/// 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.
/// Default is no timeout.
#[serde(rename = "timeout", default, skip_serializing_if = "Option::is_none")]
pub timeout: Option<String>,
/// The configuration of search extensions defined by OpenSearch plugins.
#[serde(rename = "ext", default, skip_serializing_if = "Option::is_none")]
pub ext: Option<serde_json::Value>,
/// An 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>>,
/// Boosts the `_score` of documents from the specified indexes.
#[serde(
rename = "indices_boost",
default,
skip_serializing_if = "Option::is_none"
)]
pub indices_boost: Option<Vec<serde_json::Value>>,
#[serde(rename = "pit", default, skip_serializing_if = "Option::is_none")]
pub pit: Option<core::search::PointInTimeReference>,
}
impl MultisearchBody {
pub fn new() -> MultisearchBody {
MultisearchBody {
explain: None,
stored_fields: None,
profile: None,
suggest: None,
track_scores: None,
aggregations: None,
size: None,
track_total_hits: None,
min_score: None,
stats: None,
version: None,
sort: None,
from: None,
source: None,
post_filter: None,
highlight: None,
collapse: None,
query: None,
seq_no_primary_term: None,
docvalue_fields: None,
script_fields: None,
terminate_after: None,
timeout: None,
ext: None,
fields: None,
indices_boost: None,
pit: None,
}
}
}