aws_sdk_kendra/operation/query/_query_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct QueryInput {
6 /// <p>The identifier of the index for the search.</p>
7 pub index_id: ::std::option::Option<::std::string::String>,
8 /// <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>
9 pub query_text: ::std::option::Option<::std::string::String>,
10 /// <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>
11 /// <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>
12 /// <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>
13 /// </note>
14 pub attribute_filter: ::std::option::Option<crate::types::AttributeFilter>,
15 /// <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>
16 pub facets: ::std::option::Option<::std::vec::Vec<crate::types::Facet>>,
17 /// <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>
18 pub requested_document_attributes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
19 /// <p>Sets the type of query result or response. Only results for the specified type are returned.</p>
20 pub query_result_type_filter: ::std::option::Option<crate::types::QueryResultType>,
21 /// <p>Overrides relevance tuning configurations of fields/attributes set at the index level.</p>
22 /// <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>
23 /// <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>
24 pub document_relevance_override_configurations: ::std::option::Option<::std::vec::Vec<crate::types::DocumentRelevanceConfiguration>>,
25 /// <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>
26 pub page_number: ::std::option::Option<i32>,
27 /// <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>
28 pub page_size: ::std::option::Option<i32>,
29 /// <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>
30 /// <p>If you don't provide sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result.</p>
31 pub sorting_configuration: ::std::option::Option<crate::types::SortingConfiguration>,
32 /// <p>Provides configuration information to determine how the results of a query are sorted.</p>
33 /// <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>
34 /// <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>
35 pub sorting_configurations: ::std::option::Option<::std::vec::Vec<crate::types::SortingConfiguration>>,
36 /// <p>The user context token or user and group information.</p>
37 pub user_context: ::std::option::Option<crate::types::UserContext>,
38 /// <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>
39 pub visitor_id: ::std::option::Option<::std::string::String>,
40 /// <p>Enables suggested spell corrections for queries.</p>
41 pub spell_correction_configuration: ::std::option::Option<crate::types::SpellCorrectionConfiguration>,
42 /// <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>
43 pub collapse_configuration: ::std::option::Option<crate::types::CollapseConfiguration>,
44}
45impl QueryInput {
46 /// <p>The identifier of the index for the search.</p>
47 pub fn index_id(&self) -> ::std::option::Option<&str> {
48 self.index_id.as_deref()
49 }
50 /// <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>
51 pub fn query_text(&self) -> ::std::option::Option<&str> {
52 self.query_text.as_deref()
53 }
54 /// <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>
55 /// <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>
56 /// <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>
57 /// </note>
58 pub fn attribute_filter(&self) -> ::std::option::Option<&crate::types::AttributeFilter> {
59 self.attribute_filter.as_ref()
60 }
61 /// <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>
62 ///
63 /// 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()`.
64 pub fn facets(&self) -> &[crate::types::Facet] {
65 self.facets.as_deref().unwrap_or_default()
66 }
67 /// <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>
68 ///
69 /// 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()`.
70 pub fn requested_document_attributes(&self) -> &[::std::string::String] {
71 self.requested_document_attributes.as_deref().unwrap_or_default()
72 }
73 /// <p>Sets the type of query result or response. Only results for the specified type are returned.</p>
74 pub fn query_result_type_filter(&self) -> ::std::option::Option<&crate::types::QueryResultType> {
75 self.query_result_type_filter.as_ref()
76 }
77 /// <p>Overrides relevance tuning configurations of fields/attributes set at the index level.</p>
78 /// <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>
79 /// <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>
80 ///
81 /// 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()`.
82 pub fn document_relevance_override_configurations(&self) -> &[crate::types::DocumentRelevanceConfiguration] {
83 self.document_relevance_override_configurations.as_deref().unwrap_or_default()
84 }
85 /// <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>
86 pub fn page_number(&self) -> ::std::option::Option<i32> {
87 self.page_number
88 }
89 /// <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>
90 pub fn page_size(&self) -> ::std::option::Option<i32> {
91 self.page_size
92 }
93 /// <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>
94 /// <p>If you don't provide sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result.</p>
95 pub fn sorting_configuration(&self) -> ::std::option::Option<&crate::types::SortingConfiguration> {
96 self.sorting_configuration.as_ref()
97 }
98 /// <p>Provides configuration information to determine how the results of a query are sorted.</p>
99 /// <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>
100 /// <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>
101 ///
102 /// 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()`.
103 pub fn sorting_configurations(&self) -> &[crate::types::SortingConfiguration] {
104 self.sorting_configurations.as_deref().unwrap_or_default()
105 }
106 /// <p>The user context token or user and group information.</p>
107 pub fn user_context(&self) -> ::std::option::Option<&crate::types::UserContext> {
108 self.user_context.as_ref()
109 }
110 /// <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>
111 pub fn visitor_id(&self) -> ::std::option::Option<&str> {
112 self.visitor_id.as_deref()
113 }
114 /// <p>Enables suggested spell corrections for queries.</p>
115 pub fn spell_correction_configuration(&self) -> ::std::option::Option<&crate::types::SpellCorrectionConfiguration> {
116 self.spell_correction_configuration.as_ref()
117 }
118 /// <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>
119 pub fn collapse_configuration(&self) -> ::std::option::Option<&crate::types::CollapseConfiguration> {
120 self.collapse_configuration.as_ref()
121 }
122}
123impl QueryInput {
124 /// Creates a new builder-style object to manufacture [`QueryInput`](crate::operation::query::QueryInput).
125 pub fn builder() -> crate::operation::query::builders::QueryInputBuilder {
126 crate::operation::query::builders::QueryInputBuilder::default()
127 }
128}
129
130/// A builder for [`QueryInput`](crate::operation::query::QueryInput).
131#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
132#[non_exhaustive]
133pub struct QueryInputBuilder {
134 pub(crate) index_id: ::std::option::Option<::std::string::String>,
135 pub(crate) query_text: ::std::option::Option<::std::string::String>,
136 pub(crate) attribute_filter: ::std::option::Option<crate::types::AttributeFilter>,
137 pub(crate) facets: ::std::option::Option<::std::vec::Vec<crate::types::Facet>>,
138 pub(crate) requested_document_attributes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
139 pub(crate) query_result_type_filter: ::std::option::Option<crate::types::QueryResultType>,
140 pub(crate) document_relevance_override_configurations: ::std::option::Option<::std::vec::Vec<crate::types::DocumentRelevanceConfiguration>>,
141 pub(crate) page_number: ::std::option::Option<i32>,
142 pub(crate) page_size: ::std::option::Option<i32>,
143 pub(crate) sorting_configuration: ::std::option::Option<crate::types::SortingConfiguration>,
144 pub(crate) sorting_configurations: ::std::option::Option<::std::vec::Vec<crate::types::SortingConfiguration>>,
145 pub(crate) user_context: ::std::option::Option<crate::types::UserContext>,
146 pub(crate) visitor_id: ::std::option::Option<::std::string::String>,
147 pub(crate) spell_correction_configuration: ::std::option::Option<crate::types::SpellCorrectionConfiguration>,
148 pub(crate) collapse_configuration: ::std::option::Option<crate::types::CollapseConfiguration>,
149}
150impl QueryInputBuilder {
151 /// <p>The identifier of the index for the search.</p>
152 /// This field is required.
153 pub fn index_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154 self.index_id = ::std::option::Option::Some(input.into());
155 self
156 }
157 /// <p>The identifier of the index for the search.</p>
158 pub fn set_index_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159 self.index_id = input;
160 self
161 }
162 /// <p>The identifier of the index for the search.</p>
163 pub fn get_index_id(&self) -> &::std::option::Option<::std::string::String> {
164 &self.index_id
165 }
166 /// <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>
167 pub fn query_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168 self.query_text = ::std::option::Option::Some(input.into());
169 self
170 }
171 /// <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>
172 pub fn set_query_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173 self.query_text = input;
174 self
175 }
176 /// <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>
177 pub fn get_query_text(&self) -> &::std::option::Option<::std::string::String> {
178 &self.query_text
179 }
180 /// <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>
181 /// <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>
182 /// <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>
183 /// </note>
184 pub fn attribute_filter(mut self, input: crate::types::AttributeFilter) -> Self {
185 self.attribute_filter = ::std::option::Option::Some(input);
186 self
187 }
188 /// <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>
189 /// <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>
190 /// <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>
191 /// </note>
192 pub fn set_attribute_filter(mut self, input: ::std::option::Option<crate::types::AttributeFilter>) -> Self {
193 self.attribute_filter = input;
194 self
195 }
196 /// <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>
197 /// <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>
198 /// <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>
199 /// </note>
200 pub fn get_attribute_filter(&self) -> &::std::option::Option<crate::types::AttributeFilter> {
201 &self.attribute_filter
202 }
203 /// Appends an item to `facets`.
204 ///
205 /// To override the contents of this collection use [`set_facets`](Self::set_facets).
206 ///
207 /// <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>
208 pub fn facets(mut self, input: crate::types::Facet) -> Self {
209 let mut v = self.facets.unwrap_or_default();
210 v.push(input);
211 self.facets = ::std::option::Option::Some(v);
212 self
213 }
214 /// <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>
215 pub fn set_facets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Facet>>) -> Self {
216 self.facets = input;
217 self
218 }
219 /// <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>
220 pub fn get_facets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Facet>> {
221 &self.facets
222 }
223 /// Appends an item to `requested_document_attributes`.
224 ///
225 /// To override the contents of this collection use [`set_requested_document_attributes`](Self::set_requested_document_attributes).
226 ///
227 /// <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>
228 pub fn requested_document_attributes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
229 let mut v = self.requested_document_attributes.unwrap_or_default();
230 v.push(input.into());
231 self.requested_document_attributes = ::std::option::Option::Some(v);
232 self
233 }
234 /// <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>
235 pub fn set_requested_document_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
236 self.requested_document_attributes = input;
237 self
238 }
239 /// <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>
240 pub fn get_requested_document_attributes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
241 &self.requested_document_attributes
242 }
243 /// <p>Sets the type of query result or response. Only results for the specified type are returned.</p>
244 pub fn query_result_type_filter(mut self, input: crate::types::QueryResultType) -> Self {
245 self.query_result_type_filter = ::std::option::Option::Some(input);
246 self
247 }
248 /// <p>Sets the type of query result or response. Only results for the specified type are returned.</p>
249 pub fn set_query_result_type_filter(mut self, input: ::std::option::Option<crate::types::QueryResultType>) -> Self {
250 self.query_result_type_filter = input;
251 self
252 }
253 /// <p>Sets the type of query result or response. Only results for the specified type are returned.</p>
254 pub fn get_query_result_type_filter(&self) -> &::std::option::Option<crate::types::QueryResultType> {
255 &self.query_result_type_filter
256 }
257 /// Appends an item to `document_relevance_override_configurations`.
258 ///
259 /// To override the contents of this collection use [`set_document_relevance_override_configurations`](Self::set_document_relevance_override_configurations).
260 ///
261 /// <p>Overrides relevance tuning configurations of fields/attributes set at the index level.</p>
262 /// <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>
263 /// <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>
264 pub fn document_relevance_override_configurations(mut self, input: crate::types::DocumentRelevanceConfiguration) -> Self {
265 let mut v = self.document_relevance_override_configurations.unwrap_or_default();
266 v.push(input);
267 self.document_relevance_override_configurations = ::std::option::Option::Some(v);
268 self
269 }
270 /// <p>Overrides relevance tuning configurations of fields/attributes set at the index level.</p>
271 /// <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>
272 /// <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>
273 pub fn set_document_relevance_override_configurations(
274 mut self,
275 input: ::std::option::Option<::std::vec::Vec<crate::types::DocumentRelevanceConfiguration>>,
276 ) -> Self {
277 self.document_relevance_override_configurations = input;
278 self
279 }
280 /// <p>Overrides relevance tuning configurations of fields/attributes set at the index level.</p>
281 /// <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>
282 /// <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>
283 pub fn get_document_relevance_override_configurations(
284 &self,
285 ) -> &::std::option::Option<::std::vec::Vec<crate::types::DocumentRelevanceConfiguration>> {
286 &self.document_relevance_override_configurations
287 }
288 /// <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>
289 pub fn page_number(mut self, input: i32) -> Self {
290 self.page_number = ::std::option::Option::Some(input);
291 self
292 }
293 /// <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>
294 pub fn set_page_number(mut self, input: ::std::option::Option<i32>) -> Self {
295 self.page_number = input;
296 self
297 }
298 /// <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>
299 pub fn get_page_number(&self) -> &::std::option::Option<i32> {
300 &self.page_number
301 }
302 /// <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>
303 pub fn page_size(mut self, input: i32) -> Self {
304 self.page_size = ::std::option::Option::Some(input);
305 self
306 }
307 /// <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>
308 pub fn set_page_size(mut self, input: ::std::option::Option<i32>) -> Self {
309 self.page_size = input;
310 self
311 }
312 /// <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>
313 pub fn get_page_size(&self) -> &::std::option::Option<i32> {
314 &self.page_size
315 }
316 /// <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>
317 /// <p>If you don't provide sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result.</p>
318 pub fn sorting_configuration(mut self, input: crate::types::SortingConfiguration) -> Self {
319 self.sorting_configuration = ::std::option::Option::Some(input);
320 self
321 }
322 /// <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>
323 /// <p>If you don't provide sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result.</p>
324 pub fn set_sorting_configuration(mut self, input: ::std::option::Option<crate::types::SortingConfiguration>) -> Self {
325 self.sorting_configuration = input;
326 self
327 }
328 /// <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>
329 /// <p>If you don't provide sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result.</p>
330 pub fn get_sorting_configuration(&self) -> &::std::option::Option<crate::types::SortingConfiguration> {
331 &self.sorting_configuration
332 }
333 /// Appends an item to `sorting_configurations`.
334 ///
335 /// To override the contents of this collection use [`set_sorting_configurations`](Self::set_sorting_configurations).
336 ///
337 /// <p>Provides configuration information to determine how the results of a query are sorted.</p>
338 /// <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>
339 /// <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>
340 pub fn sorting_configurations(mut self, input: crate::types::SortingConfiguration) -> Self {
341 let mut v = self.sorting_configurations.unwrap_or_default();
342 v.push(input);
343 self.sorting_configurations = ::std::option::Option::Some(v);
344 self
345 }
346 /// <p>Provides configuration information to determine how the results of a query are sorted.</p>
347 /// <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>
348 /// <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>
349 pub fn set_sorting_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SortingConfiguration>>) -> Self {
350 self.sorting_configurations = input;
351 self
352 }
353 /// <p>Provides configuration information to determine how the results of a query are sorted.</p>
354 /// <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>
355 /// <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>
356 pub fn get_sorting_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SortingConfiguration>> {
357 &self.sorting_configurations
358 }
359 /// <p>The user context token or user and group information.</p>
360 pub fn user_context(mut self, input: crate::types::UserContext) -> Self {
361 self.user_context = ::std::option::Option::Some(input);
362 self
363 }
364 /// <p>The user context token or user and group information.</p>
365 pub fn set_user_context(mut self, input: ::std::option::Option<crate::types::UserContext>) -> Self {
366 self.user_context = input;
367 self
368 }
369 /// <p>The user context token or user and group information.</p>
370 pub fn get_user_context(&self) -> &::std::option::Option<crate::types::UserContext> {
371 &self.user_context
372 }
373 /// <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>
374 pub fn visitor_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
375 self.visitor_id = ::std::option::Option::Some(input.into());
376 self
377 }
378 /// <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>
379 pub fn set_visitor_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
380 self.visitor_id = input;
381 self
382 }
383 /// <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>
384 pub fn get_visitor_id(&self) -> &::std::option::Option<::std::string::String> {
385 &self.visitor_id
386 }
387 /// <p>Enables suggested spell corrections for queries.</p>
388 pub fn spell_correction_configuration(mut self, input: crate::types::SpellCorrectionConfiguration) -> Self {
389 self.spell_correction_configuration = ::std::option::Option::Some(input);
390 self
391 }
392 /// <p>Enables suggested spell corrections for queries.</p>
393 pub fn set_spell_correction_configuration(mut self, input: ::std::option::Option<crate::types::SpellCorrectionConfiguration>) -> Self {
394 self.spell_correction_configuration = input;
395 self
396 }
397 /// <p>Enables suggested spell corrections for queries.</p>
398 pub fn get_spell_correction_configuration(&self) -> &::std::option::Option<crate::types::SpellCorrectionConfiguration> {
399 &self.spell_correction_configuration
400 }
401 /// <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>
402 pub fn collapse_configuration(mut self, input: crate::types::CollapseConfiguration) -> Self {
403 self.collapse_configuration = ::std::option::Option::Some(input);
404 self
405 }
406 /// <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>
407 pub fn set_collapse_configuration(mut self, input: ::std::option::Option<crate::types::CollapseConfiguration>) -> Self {
408 self.collapse_configuration = input;
409 self
410 }
411 /// <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>
412 pub fn get_collapse_configuration(&self) -> &::std::option::Option<crate::types::CollapseConfiguration> {
413 &self.collapse_configuration
414 }
415 /// Consumes the builder and constructs a [`QueryInput`](crate::operation::query::QueryInput).
416 pub fn build(self) -> ::std::result::Result<crate::operation::query::QueryInput, ::aws_smithy_types::error::operation::BuildError> {
417 ::std::result::Result::Ok(crate::operation::query::QueryInput {
418 index_id: self.index_id,
419 query_text: self.query_text,
420 attribute_filter: self.attribute_filter,
421 facets: self.facets,
422 requested_document_attributes: self.requested_document_attributes,
423 query_result_type_filter: self.query_result_type_filter,
424 document_relevance_override_configurations: self.document_relevance_override_configurations,
425 page_number: self.page_number,
426 page_size: self.page_size,
427 sorting_configuration: self.sorting_configuration,
428 sorting_configurations: self.sorting_configurations,
429 user_context: self.user_context,
430 visitor_id: self.visitor_id,
431 spell_correction_configuration: self.spell_correction_configuration,
432 collapse_configuration: self.collapse_configuration,
433 })
434 }
435}