// 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,
})
}
}