aws-sdk-kendra 1.95.0

AWS SDK for AWSKendraFrontendService
Documentation
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct QueryInput {
    /// <p>The identifier of the index for the search.</p>
    pub index_id: ::std::option::Option<::std::string::String>,
    /// <p>The input query text for the search. Amazon Kendra truncates queries at 30 token words, which excludes punctuation and stop words. Truncation still applies if you use Boolean or more advanced, complex queries. For example, <code>Timeoff AND October AND Category:HR</code> is counted as 3 tokens: <code>timeoff</code>, <code>october</code>, <code>hr</code>. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/searching-example.html#searching-index-query-syntax">Searching with advanced query syntax</a> in the Amazon Kendra Developer Guide.</p>
    pub query_text: ::std::option::Option<::std::string::String>,
    /// <p>Filters search results by document fields/attributes. You can only provide one attribute filter; however, the <code>AndAllFilters</code>, <code>NotFilter</code>, and <code>OrAllFilters</code> parameters contain a list of other filters.</p>
    /// <p>The <code>AttributeFilter</code> parameter means you can create a set of filtering rules that a document must satisfy to be included in the query results.</p><note>
    /// <p>For Amazon Kendra Gen AI Enterprise Edition indices use <code>AttributeFilter</code> to enable document filtering for end users using <code>_email_id</code> or include public documents (<code>_email_id=null</code>).</p>
    /// </note>
    pub attribute_filter: ::std::option::Option<crate::types::AttributeFilter>,
    /// <p>An array of documents fields/attributes for faceted search. Amazon Kendra returns a count for each field key specified. This helps your users narrow their search.</p>
    pub facets: ::std::option::Option<::std::vec::Vec<crate::types::Facet>>,
    /// <p>An array of document fields/attributes to include in the response. You can limit the response to include certain document fields. By default, all document attributes are included in the response.</p>
    pub requested_document_attributes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Sets the type of query result or response. Only results for the specified type are returned.</p>
    pub query_result_type_filter: ::std::option::Option<crate::types::QueryResultType>,
    /// <p>Overrides relevance tuning configurations of fields/attributes set at the index level.</p>
    /// <p>If you use this API to override the relevance tuning configured at the index level, but there is no relevance tuning configured at the index level, then Amazon Kendra does not apply any relevance tuning.</p>
    /// <p>If there is relevance tuning configured for fields at the index level, and you use this API to override only some of these fields, then for the fields you did not override, the importance is set to 1.</p>
    pub document_relevance_override_configurations: ::std::option::Option<::std::vec::Vec<crate::types::DocumentRelevanceConfiguration>>,
    /// <p>Query results are returned in pages the size of the <code>PageSize</code> parameter. By default, Amazon Kendra returns the first page of results. Use this parameter to get result pages after the first one.</p>
    pub page_number: ::std::option::Option<i32>,
    /// <p>Sets the number of results that are returned in each page of results. The default page size is 10. The maximum number of results returned is 100. If you ask for more than 100 results, only 100 are returned.</p>
    pub page_size: ::std::option::Option<i32>,
    /// <p>Provides information that determines how the results of the query are sorted. You can set the field that Amazon Kendra should sort the results on, and specify whether the results should be sorted in ascending or descending order. In the case of ties in sorting the results, the results are sorted by relevance.</p>
    /// <p>If you don't provide sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result.</p>
    pub sorting_configuration: ::std::option::Option<crate::types::SortingConfiguration>,
    /// <p>Provides configuration information to determine how the results of a query are sorted.</p>
    /// <p>You can set upto 3 fields that Amazon Kendra should sort the results on, and specify whether the results should be sorted in ascending or descending order. The sort field quota can be increased.</p>
    /// <p>If you don't provide a sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result. In the case of ties in sorting the results, the results are sorted by relevance.</p>
    pub sorting_configurations: ::std::option::Option<::std::vec::Vec<crate::types::SortingConfiguration>>,
    /// <p>The user context token or user and group information.</p>
    pub user_context: ::std::option::Option<crate::types::UserContext>,
    /// <p>Provides an identifier for a specific user. The <code>VisitorId</code> should be a unique identifier, such as a GUID. Don't use personally identifiable information, such as the user's email address, as the <code>VisitorId</code>.</p>
    pub visitor_id: ::std::option::Option<::std::string::String>,
    /// <p>Enables suggested spell corrections for queries.</p>
    pub spell_correction_configuration: ::std::option::Option<crate::types::SpellCorrectionConfiguration>,
    /// <p>Provides configuration to determine how to group results by document attribute value, and how to display them (collapsed or expanded) under a designated primary document for each group.</p>
    pub collapse_configuration: ::std::option::Option<crate::types::CollapseConfiguration>,
}
impl QueryInput {
    /// <p>The identifier of the index for the search.</p>
    pub fn index_id(&self) -> ::std::option::Option<&str> {
        self.index_id.as_deref()
    }
    /// <p>The input query text for the search. Amazon Kendra truncates queries at 30 token words, which excludes punctuation and stop words. Truncation still applies if you use Boolean or more advanced, complex queries. For example, <code>Timeoff AND October AND Category:HR</code> is counted as 3 tokens: <code>timeoff</code>, <code>october</code>, <code>hr</code>. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/searching-example.html#searching-index-query-syntax">Searching with advanced query syntax</a> in the Amazon Kendra Developer Guide.</p>
    pub fn query_text(&self) -> ::std::option::Option<&str> {
        self.query_text.as_deref()
    }
    /// <p>Filters search results by document fields/attributes. You can only provide one attribute filter; however, the <code>AndAllFilters</code>, <code>NotFilter</code>, and <code>OrAllFilters</code> parameters contain a list of other filters.</p>
    /// <p>The <code>AttributeFilter</code> parameter means you can create a set of filtering rules that a document must satisfy to be included in the query results.</p><note>
    /// <p>For Amazon Kendra Gen AI Enterprise Edition indices use <code>AttributeFilter</code> to enable document filtering for end users using <code>_email_id</code> or include public documents (<code>_email_id=null</code>).</p>
    /// </note>
    pub fn attribute_filter(&self) -> ::std::option::Option<&crate::types::AttributeFilter> {
        self.attribute_filter.as_ref()
    }
    /// <p>An array of documents fields/attributes for faceted search. Amazon Kendra returns a count for each field key specified. This helps your users narrow their search.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.facets.is_none()`.
    pub fn facets(&self) -> &[crate::types::Facet] {
        self.facets.as_deref().unwrap_or_default()
    }
    /// <p>An array of document fields/attributes to include in the response. You can limit the response to include certain document fields. By default, all document attributes are included in the response.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.requested_document_attributes.is_none()`.
    pub fn requested_document_attributes(&self) -> &[::std::string::String] {
        self.requested_document_attributes.as_deref().unwrap_or_default()
    }
    /// <p>Sets the type of query result or response. Only results for the specified type are returned.</p>
    pub fn query_result_type_filter(&self) -> ::std::option::Option<&crate::types::QueryResultType> {
        self.query_result_type_filter.as_ref()
    }
    /// <p>Overrides relevance tuning configurations of fields/attributes set at the index level.</p>
    /// <p>If you use this API to override the relevance tuning configured at the index level, but there is no relevance tuning configured at the index level, then Amazon Kendra does not apply any relevance tuning.</p>
    /// <p>If there is relevance tuning configured for fields at the index level, and you use this API to override only some of these fields, then for the fields you did not override, the importance is set to 1.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.document_relevance_override_configurations.is_none()`.
    pub fn document_relevance_override_configurations(&self) -> &[crate::types::DocumentRelevanceConfiguration] {
        self.document_relevance_override_configurations.as_deref().unwrap_or_default()
    }
    /// <p>Query results are returned in pages the size of the <code>PageSize</code> parameter. By default, Amazon Kendra returns the first page of results. Use this parameter to get result pages after the first one.</p>
    pub fn page_number(&self) -> ::std::option::Option<i32> {
        self.page_number
    }
    /// <p>Sets the number of results that are returned in each page of results. The default page size is 10. The maximum number of results returned is 100. If you ask for more than 100 results, only 100 are returned.</p>
    pub fn page_size(&self) -> ::std::option::Option<i32> {
        self.page_size
    }
    /// <p>Provides information that determines how the results of the query are sorted. You can set the field that Amazon Kendra should sort the results on, and specify whether the results should be sorted in ascending or descending order. In the case of ties in sorting the results, the results are sorted by relevance.</p>
    /// <p>If you don't provide sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result.</p>
    pub fn sorting_configuration(&self) -> ::std::option::Option<&crate::types::SortingConfiguration> {
        self.sorting_configuration.as_ref()
    }
    /// <p>Provides configuration information to determine how the results of a query are sorted.</p>
    /// <p>You can set upto 3 fields that Amazon Kendra should sort the results on, and specify whether the results should be sorted in ascending or descending order. The sort field quota can be increased.</p>
    /// <p>If you don't provide a sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result. In the case of ties in sorting the results, the results are sorted by relevance.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.sorting_configurations.is_none()`.
    pub fn sorting_configurations(&self) -> &[crate::types::SortingConfiguration] {
        self.sorting_configurations.as_deref().unwrap_or_default()
    }
    /// <p>The user context token or user and group information.</p>
    pub fn user_context(&self) -> ::std::option::Option<&crate::types::UserContext> {
        self.user_context.as_ref()
    }
    /// <p>Provides an identifier for a specific user. The <code>VisitorId</code> should be a unique identifier, such as a GUID. Don't use personally identifiable information, such as the user's email address, as the <code>VisitorId</code>.</p>
    pub fn visitor_id(&self) -> ::std::option::Option<&str> {
        self.visitor_id.as_deref()
    }
    /// <p>Enables suggested spell corrections for queries.</p>
    pub fn spell_correction_configuration(&self) -> ::std::option::Option<&crate::types::SpellCorrectionConfiguration> {
        self.spell_correction_configuration.as_ref()
    }
    /// <p>Provides configuration to determine how to group results by document attribute value, and how to display them (collapsed or expanded) under a designated primary document for each group.</p>
    pub fn collapse_configuration(&self) -> ::std::option::Option<&crate::types::CollapseConfiguration> {
        self.collapse_configuration.as_ref()
    }
}
impl QueryInput {
    /// Creates a new builder-style object to manufacture [`QueryInput`](crate::operation::query::QueryInput).
    pub fn builder() -> crate::operation::query::builders::QueryInputBuilder {
        crate::operation::query::builders::QueryInputBuilder::default()
    }
}

/// A builder for [`QueryInput`](crate::operation::query::QueryInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct QueryInputBuilder {
    pub(crate) index_id: ::std::option::Option<::std::string::String>,
    pub(crate) query_text: ::std::option::Option<::std::string::String>,
    pub(crate) attribute_filter: ::std::option::Option<crate::types::AttributeFilter>,
    pub(crate) facets: ::std::option::Option<::std::vec::Vec<crate::types::Facet>>,
    pub(crate) requested_document_attributes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) query_result_type_filter: ::std::option::Option<crate::types::QueryResultType>,
    pub(crate) document_relevance_override_configurations: ::std::option::Option<::std::vec::Vec<crate::types::DocumentRelevanceConfiguration>>,
    pub(crate) page_number: ::std::option::Option<i32>,
    pub(crate) page_size: ::std::option::Option<i32>,
    pub(crate) sorting_configuration: ::std::option::Option<crate::types::SortingConfiguration>,
    pub(crate) sorting_configurations: ::std::option::Option<::std::vec::Vec<crate::types::SortingConfiguration>>,
    pub(crate) user_context: ::std::option::Option<crate::types::UserContext>,
    pub(crate) visitor_id: ::std::option::Option<::std::string::String>,
    pub(crate) spell_correction_configuration: ::std::option::Option<crate::types::SpellCorrectionConfiguration>,
    pub(crate) collapse_configuration: ::std::option::Option<crate::types::CollapseConfiguration>,
}
impl QueryInputBuilder {
    /// <p>The identifier of the index for the search.</p>
    /// This field is required.
    pub fn index_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.index_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the index for the search.</p>
    pub fn set_index_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.index_id = input;
        self
    }
    /// <p>The identifier of the index for the search.</p>
    pub fn get_index_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.index_id
    }
    /// <p>The input query text for the search. Amazon Kendra truncates queries at 30 token words, which excludes punctuation and stop words. Truncation still applies if you use Boolean or more advanced, complex queries. For example, <code>Timeoff AND October AND Category:HR</code> is counted as 3 tokens: <code>timeoff</code>, <code>october</code>, <code>hr</code>. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/searching-example.html#searching-index-query-syntax">Searching with advanced query syntax</a> in the Amazon Kendra Developer Guide.</p>
    pub fn query_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.query_text = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The input query text for the search. Amazon Kendra truncates queries at 30 token words, which excludes punctuation and stop words. Truncation still applies if you use Boolean or more advanced, complex queries. For example, <code>Timeoff AND October AND Category:HR</code> is counted as 3 tokens: <code>timeoff</code>, <code>october</code>, <code>hr</code>. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/searching-example.html#searching-index-query-syntax">Searching with advanced query syntax</a> in the Amazon Kendra Developer Guide.</p>
    pub fn set_query_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.query_text = input;
        self
    }
    /// <p>The input query text for the search. Amazon Kendra truncates queries at 30 token words, which excludes punctuation and stop words. Truncation still applies if you use Boolean or more advanced, complex queries. For example, <code>Timeoff AND October AND Category:HR</code> is counted as 3 tokens: <code>timeoff</code>, <code>october</code>, <code>hr</code>. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/searching-example.html#searching-index-query-syntax">Searching with advanced query syntax</a> in the Amazon Kendra Developer Guide.</p>
    pub fn get_query_text(&self) -> &::std::option::Option<::std::string::String> {
        &self.query_text
    }
    /// <p>Filters search results by document fields/attributes. You can only provide one attribute filter; however, the <code>AndAllFilters</code>, <code>NotFilter</code>, and <code>OrAllFilters</code> parameters contain a list of other filters.</p>
    /// <p>The <code>AttributeFilter</code> parameter means you can create a set of filtering rules that a document must satisfy to be included in the query results.</p><note>
    /// <p>For Amazon Kendra Gen AI Enterprise Edition indices use <code>AttributeFilter</code> to enable document filtering for end users using <code>_email_id</code> or include public documents (<code>_email_id=null</code>).</p>
    /// </note>
    pub fn attribute_filter(mut self, input: crate::types::AttributeFilter) -> Self {
        self.attribute_filter = ::std::option::Option::Some(input);
        self
    }
    /// <p>Filters search results by document fields/attributes. You can only provide one attribute filter; however, the <code>AndAllFilters</code>, <code>NotFilter</code>, and <code>OrAllFilters</code> parameters contain a list of other filters.</p>
    /// <p>The <code>AttributeFilter</code> parameter means you can create a set of filtering rules that a document must satisfy to be included in the query results.</p><note>
    /// <p>For Amazon Kendra Gen AI Enterprise Edition indices use <code>AttributeFilter</code> to enable document filtering for end users using <code>_email_id</code> or include public documents (<code>_email_id=null</code>).</p>
    /// </note>
    pub fn set_attribute_filter(mut self, input: ::std::option::Option<crate::types::AttributeFilter>) -> Self {
        self.attribute_filter = input;
        self
    }
    /// <p>Filters search results by document fields/attributes. You can only provide one attribute filter; however, the <code>AndAllFilters</code>, <code>NotFilter</code>, and <code>OrAllFilters</code> parameters contain a list of other filters.</p>
    /// <p>The <code>AttributeFilter</code> parameter means you can create a set of filtering rules that a document must satisfy to be included in the query results.</p><note>
    /// <p>For Amazon Kendra Gen AI Enterprise Edition indices use <code>AttributeFilter</code> to enable document filtering for end users using <code>_email_id</code> or include public documents (<code>_email_id=null</code>).</p>
    /// </note>
    pub fn get_attribute_filter(&self) -> &::std::option::Option<crate::types::AttributeFilter> {
        &self.attribute_filter
    }
    /// Appends an item to `facets`.
    ///
    /// To override the contents of this collection use [`set_facets`](Self::set_facets).
    ///
    /// <p>An array of documents fields/attributes for faceted search. Amazon Kendra returns a count for each field key specified. This helps your users narrow their search.</p>
    pub fn facets(mut self, input: crate::types::Facet) -> Self {
        let mut v = self.facets.unwrap_or_default();
        v.push(input);
        self.facets = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of documents fields/attributes for faceted search. Amazon Kendra returns a count for each field key specified. This helps your users narrow their search.</p>
    pub fn set_facets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Facet>>) -> Self {
        self.facets = input;
        self
    }
    /// <p>An array of documents fields/attributes for faceted search. Amazon Kendra returns a count for each field key specified. This helps your users narrow their search.</p>
    pub fn get_facets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Facet>> {
        &self.facets
    }
    /// Appends an item to `requested_document_attributes`.
    ///
    /// To override the contents of this collection use [`set_requested_document_attributes`](Self::set_requested_document_attributes).
    ///
    /// <p>An array of document fields/attributes to include in the response. You can limit the response to include certain document fields. By default, all document attributes are included in the response.</p>
    pub fn requested_document_attributes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.requested_document_attributes.unwrap_or_default();
        v.push(input.into());
        self.requested_document_attributes = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of document fields/attributes to include in the response. You can limit the response to include certain document fields. By default, all document attributes are included in the response.</p>
    pub fn set_requested_document_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.requested_document_attributes = input;
        self
    }
    /// <p>An array of document fields/attributes to include in the response. You can limit the response to include certain document fields. By default, all document attributes are included in the response.</p>
    pub fn get_requested_document_attributes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.requested_document_attributes
    }
    /// <p>Sets the type of query result or response. Only results for the specified type are returned.</p>
    pub fn query_result_type_filter(mut self, input: crate::types::QueryResultType) -> Self {
        self.query_result_type_filter = ::std::option::Option::Some(input);
        self
    }
    /// <p>Sets the type of query result or response. Only results for the specified type are returned.</p>
    pub fn set_query_result_type_filter(mut self, input: ::std::option::Option<crate::types::QueryResultType>) -> Self {
        self.query_result_type_filter = input;
        self
    }
    /// <p>Sets the type of query result or response. Only results for the specified type are returned.</p>
    pub fn get_query_result_type_filter(&self) -> &::std::option::Option<crate::types::QueryResultType> {
        &self.query_result_type_filter
    }
    /// Appends an item to `document_relevance_override_configurations`.
    ///
    /// To override the contents of this collection use [`set_document_relevance_override_configurations`](Self::set_document_relevance_override_configurations).
    ///
    /// <p>Overrides relevance tuning configurations of fields/attributes set at the index level.</p>
    /// <p>If you use this API to override the relevance tuning configured at the index level, but there is no relevance tuning configured at the index level, then Amazon Kendra does not apply any relevance tuning.</p>
    /// <p>If there is relevance tuning configured for fields at the index level, and you use this API to override only some of these fields, then for the fields you did not override, the importance is set to 1.</p>
    pub fn document_relevance_override_configurations(mut self, input: crate::types::DocumentRelevanceConfiguration) -> Self {
        let mut v = self.document_relevance_override_configurations.unwrap_or_default();
        v.push(input);
        self.document_relevance_override_configurations = ::std::option::Option::Some(v);
        self
    }
    /// <p>Overrides relevance tuning configurations of fields/attributes set at the index level.</p>
    /// <p>If you use this API to override the relevance tuning configured at the index level, but there is no relevance tuning configured at the index level, then Amazon Kendra does not apply any relevance tuning.</p>
    /// <p>If there is relevance tuning configured for fields at the index level, and you use this API to override only some of these fields, then for the fields you did not override, the importance is set to 1.</p>
    pub fn set_document_relevance_override_configurations(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<crate::types::DocumentRelevanceConfiguration>>,
    ) -> Self {
        self.document_relevance_override_configurations = input;
        self
    }
    /// <p>Overrides relevance tuning configurations of fields/attributes set at the index level.</p>
    /// <p>If you use this API to override the relevance tuning configured at the index level, but there is no relevance tuning configured at the index level, then Amazon Kendra does not apply any relevance tuning.</p>
    /// <p>If there is relevance tuning configured for fields at the index level, and you use this API to override only some of these fields, then for the fields you did not override, the importance is set to 1.</p>
    pub fn get_document_relevance_override_configurations(
        &self,
    ) -> &::std::option::Option<::std::vec::Vec<crate::types::DocumentRelevanceConfiguration>> {
        &self.document_relevance_override_configurations
    }
    /// <p>Query results are returned in pages the size of the <code>PageSize</code> parameter. By default, Amazon Kendra returns the first page of results. Use this parameter to get result pages after the first one.</p>
    pub fn page_number(mut self, input: i32) -> Self {
        self.page_number = ::std::option::Option::Some(input);
        self
    }
    /// <p>Query results are returned in pages the size of the <code>PageSize</code> parameter. By default, Amazon Kendra returns the first page of results. Use this parameter to get result pages after the first one.</p>
    pub fn set_page_number(mut self, input: ::std::option::Option<i32>) -> Self {
        self.page_number = input;
        self
    }
    /// <p>Query results are returned in pages the size of the <code>PageSize</code> parameter. By default, Amazon Kendra returns the first page of results. Use this parameter to get result pages after the first one.</p>
    pub fn get_page_number(&self) -> &::std::option::Option<i32> {
        &self.page_number
    }
    /// <p>Sets the number of results that are returned in each page of results. The default page size is 10. The maximum number of results returned is 100. If you ask for more than 100 results, only 100 are returned.</p>
    pub fn page_size(mut self, input: i32) -> Self {
        self.page_size = ::std::option::Option::Some(input);
        self
    }
    /// <p>Sets the number of results that are returned in each page of results. The default page size is 10. The maximum number of results returned is 100. If you ask for more than 100 results, only 100 are returned.</p>
    pub fn set_page_size(mut self, input: ::std::option::Option<i32>) -> Self {
        self.page_size = input;
        self
    }
    /// <p>Sets the number of results that are returned in each page of results. The default page size is 10. The maximum number of results returned is 100. If you ask for more than 100 results, only 100 are returned.</p>
    pub fn get_page_size(&self) -> &::std::option::Option<i32> {
        &self.page_size
    }
    /// <p>Provides information that determines how the results of the query are sorted. You can set the field that Amazon Kendra should sort the results on, and specify whether the results should be sorted in ascending or descending order. In the case of ties in sorting the results, the results are sorted by relevance.</p>
    /// <p>If you don't provide sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result.</p>
    pub fn sorting_configuration(mut self, input: crate::types::SortingConfiguration) -> Self {
        self.sorting_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>Provides information that determines how the results of the query are sorted. You can set the field that Amazon Kendra should sort the results on, and specify whether the results should be sorted in ascending or descending order. In the case of ties in sorting the results, the results are sorted by relevance.</p>
    /// <p>If you don't provide sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result.</p>
    pub fn set_sorting_configuration(mut self, input: ::std::option::Option<crate::types::SortingConfiguration>) -> Self {
        self.sorting_configuration = input;
        self
    }
    /// <p>Provides information that determines how the results of the query are sorted. You can set the field that Amazon Kendra should sort the results on, and specify whether the results should be sorted in ascending or descending order. In the case of ties in sorting the results, the results are sorted by relevance.</p>
    /// <p>If you don't provide sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result.</p>
    pub fn get_sorting_configuration(&self) -> &::std::option::Option<crate::types::SortingConfiguration> {
        &self.sorting_configuration
    }
    /// Appends an item to `sorting_configurations`.
    ///
    /// To override the contents of this collection use [`set_sorting_configurations`](Self::set_sorting_configurations).
    ///
    /// <p>Provides configuration information to determine how the results of a query are sorted.</p>
    /// <p>You can set upto 3 fields that Amazon Kendra should sort the results on, and specify whether the results should be sorted in ascending or descending order. The sort field quota can be increased.</p>
    /// <p>If you don't provide a sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result. In the case of ties in sorting the results, the results are sorted by relevance.</p>
    pub fn sorting_configurations(mut self, input: crate::types::SortingConfiguration) -> Self {
        let mut v = self.sorting_configurations.unwrap_or_default();
        v.push(input);
        self.sorting_configurations = ::std::option::Option::Some(v);
        self
    }
    /// <p>Provides configuration information to determine how the results of a query are sorted.</p>
    /// <p>You can set upto 3 fields that Amazon Kendra should sort the results on, and specify whether the results should be sorted in ascending or descending order. The sort field quota can be increased.</p>
    /// <p>If you don't provide a sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result. In the case of ties in sorting the results, the results are sorted by relevance.</p>
    pub fn set_sorting_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SortingConfiguration>>) -> Self {
        self.sorting_configurations = input;
        self
    }
    /// <p>Provides configuration information to determine how the results of a query are sorted.</p>
    /// <p>You can set upto 3 fields that Amazon Kendra should sort the results on, and specify whether the results should be sorted in ascending or descending order. The sort field quota can be increased.</p>
    /// <p>If you don't provide a sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result. In the case of ties in sorting the results, the results are sorted by relevance.</p>
    pub fn get_sorting_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SortingConfiguration>> {
        &self.sorting_configurations
    }
    /// <p>The user context token or user and group information.</p>
    pub fn user_context(mut self, input: crate::types::UserContext) -> Self {
        self.user_context = ::std::option::Option::Some(input);
        self
    }
    /// <p>The user context token or user and group information.</p>
    pub fn set_user_context(mut self, input: ::std::option::Option<crate::types::UserContext>) -> Self {
        self.user_context = input;
        self
    }
    /// <p>The user context token or user and group information.</p>
    pub fn get_user_context(&self) -> &::std::option::Option<crate::types::UserContext> {
        &self.user_context
    }
    /// <p>Provides an identifier for a specific user. The <code>VisitorId</code> should be a unique identifier, such as a GUID. Don't use personally identifiable information, such as the user's email address, as the <code>VisitorId</code>.</p>
    pub fn visitor_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.visitor_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Provides an identifier for a specific user. The <code>VisitorId</code> should be a unique identifier, such as a GUID. Don't use personally identifiable information, such as the user's email address, as the <code>VisitorId</code>.</p>
    pub fn set_visitor_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.visitor_id = input;
        self
    }
    /// <p>Provides an identifier for a specific user. The <code>VisitorId</code> should be a unique identifier, such as a GUID. Don't use personally identifiable information, such as the user's email address, as the <code>VisitorId</code>.</p>
    pub fn get_visitor_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.visitor_id
    }
    /// <p>Enables suggested spell corrections for queries.</p>
    pub fn spell_correction_configuration(mut self, input: crate::types::SpellCorrectionConfiguration) -> Self {
        self.spell_correction_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>Enables suggested spell corrections for queries.</p>
    pub fn set_spell_correction_configuration(mut self, input: ::std::option::Option<crate::types::SpellCorrectionConfiguration>) -> Self {
        self.spell_correction_configuration = input;
        self
    }
    /// <p>Enables suggested spell corrections for queries.</p>
    pub fn get_spell_correction_configuration(&self) -> &::std::option::Option<crate::types::SpellCorrectionConfiguration> {
        &self.spell_correction_configuration
    }
    /// <p>Provides configuration to determine how to group results by document attribute value, and how to display them (collapsed or expanded) under a designated primary document for each group.</p>
    pub fn collapse_configuration(mut self, input: crate::types::CollapseConfiguration) -> Self {
        self.collapse_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>Provides configuration to determine how to group results by document attribute value, and how to display them (collapsed or expanded) under a designated primary document for each group.</p>
    pub fn set_collapse_configuration(mut self, input: ::std::option::Option<crate::types::CollapseConfiguration>) -> Self {
        self.collapse_configuration = input;
        self
    }
    /// <p>Provides configuration to determine how to group results by document attribute value, and how to display them (collapsed or expanded) under a designated primary document for each group.</p>
    pub fn get_collapse_configuration(&self) -> &::std::option::Option<crate::types::CollapseConfiguration> {
        &self.collapse_configuration
    }
    /// Consumes the builder and constructs a [`QueryInput`](crate::operation::query::QueryInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::query::QueryInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::query::QueryInput {
            index_id: self.index_id,
            query_text: self.query_text,
            attribute_filter: self.attribute_filter,
            facets: self.facets,
            requested_document_attributes: self.requested_document_attributes,
            query_result_type_filter: self.query_result_type_filter,
            document_relevance_override_configurations: self.document_relevance_override_configurations,
            page_number: self.page_number,
            page_size: self.page_size,
            sorting_configuration: self.sorting_configuration,
            sorting_configurations: self.sorting_configurations,
            user_context: self.user_context,
            visitor_id: self.visitor_id,
            spell_correction_configuration: self.spell_correction_configuration,
            collapse_configuration: self.collapse_configuration,
        })
    }
}