/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.kendra.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class RetrieveRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The identifier of the index to retrieve relevant passages for the search. *
*/ private String indexId; /** ** The input query text to retrieve relevant passages 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. *
*/ private String queryText; /** *
* Filters search results by document fields/attributes. You can only provide one attribute filter; however, the
* AndAllFilters
, NotFilter
, and OrAllFilters
parameters contain a list of
* other filters.
*
* The AttributeFilter
parameter means you can create a set of filtering rules that a document must
* satisfy to be included in the query results.
*
* A list of document fields/attributes to include in the response. You can limit the response to include certain * document fields. By default, all document fields are included in the response. *
*/ private java.util.List* Overrides relevance tuning configurations of fields/attributes set at the index level. *
** 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. *
** 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. *
*/ private java.util.List
* Retrieved relevant passages are returned in pages the size of the PageSize
parameter. By default,
* Amazon Kendra returns the first page of results. Use this parameter to get result pages after the first one.
*
* Sets the number of retrieved relevant passages 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. *
*/ private Integer pageSize; /** ** The user context token or user and group information. *
*/ private UserContext userContext; /** ** The identifier of the index to retrieve relevant passages for the search. *
* * @param indexId * The identifier of the index to retrieve relevant passages for the search. */ public void setIndexId(String indexId) { this.indexId = indexId; } /** ** The identifier of the index to retrieve relevant passages for the search. *
* * @return The identifier of the index to retrieve relevant passages for the search. */ public String getIndexId() { return this.indexId; } /** ** The identifier of the index to retrieve relevant passages for the search. *
* * @param indexId * The identifier of the index to retrieve relevant passages for the search. * @return Returns a reference to this object so that method calls can be chained together. */ public RetrieveRequest withIndexId(String indexId) { setIndexId(indexId); return this; } /** ** The input query text to retrieve relevant passages 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. *
* * @param queryText * The input query text to retrieve relevant passages 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. */ public void setQueryText(String queryText) { this.queryText = queryText; } /** ** The input query text to retrieve relevant passages 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. *
* * @return The input query text to retrieve relevant passages 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. */ public String getQueryText() { return this.queryText; } /** ** The input query text to retrieve relevant passages 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. *
* * @param queryText * The input query text to retrieve relevant passages 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. * @return Returns a reference to this object so that method calls can be chained together. */ public RetrieveRequest withQueryText(String queryText) { setQueryText(queryText); return this; } /** *
* Filters search results by document fields/attributes. You can only provide one attribute filter; however, the
* AndAllFilters
, NotFilter
, and OrAllFilters
parameters contain a list of
* other filters.
*
* The AttributeFilter
parameter means you can create a set of filtering rules that a document must
* satisfy to be included in the query results.
*
AndAllFilters
, NotFilter
, and OrAllFilters
parameters contain a
* list of other filters.
*
* The AttributeFilter
parameter means you can create a set of filtering rules that a document
* must satisfy to be included in the query results.
*/
public void setAttributeFilter(AttributeFilter attributeFilter) {
this.attributeFilter = attributeFilter;
}
/**
*
* Filters search results by document fields/attributes. You can only provide one attribute filter; however, the
* AndAllFilters
, NotFilter
, and OrAllFilters
parameters contain a list of
* other filters.
*
* The AttributeFilter
parameter means you can create a set of filtering rules that a document must
* satisfy to be included in the query results.
*
AndAllFilters
, NotFilter
, and OrAllFilters
parameters contain
* a list of other filters.
*
* The AttributeFilter
parameter means you can create a set of filtering rules that a document
* must satisfy to be included in the query results.
*/
public AttributeFilter getAttributeFilter() {
return this.attributeFilter;
}
/**
*
* Filters search results by document fields/attributes. You can only provide one attribute filter; however, the
* AndAllFilters
, NotFilter
, and OrAllFilters
parameters contain a list of
* other filters.
*
* The AttributeFilter
parameter means you can create a set of filtering rules that a document must
* satisfy to be included in the query results.
*
AndAllFilters
, NotFilter
, and OrAllFilters
parameters contain a
* list of other filters.
*
* The AttributeFilter
parameter means you can create a set of filtering rules that a document
* must satisfy to be included in the query results.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RetrieveRequest withAttributeFilter(AttributeFilter attributeFilter) {
setAttributeFilter(attributeFilter);
return this;
}
/**
*
* A list of document fields/attributes to include in the response. You can limit the response to include certain * document fields. By default, all document fields are included in the response. *
* * @return A list of document fields/attributes to include in the response. You can limit the response to include * certain document fields. By default, all document fields are included in the response. */ public java.util.List* A list of document fields/attributes to include in the response. You can limit the response to include certain * document fields. By default, all document fields are included in the response. *
* * @param requestedDocumentAttributes * A list of document fields/attributes to include in the response. You can limit the response to include * certain document fields. By default, all document fields are included in the response. */ public void setRequestedDocumentAttributes(java.util.Collection* A list of document fields/attributes to include in the response. You can limit the response to include certain * document fields. By default, all document fields are included in the response. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setRequestedDocumentAttributes(java.util.Collection)} or * {@link #withRequestedDocumentAttributes(java.util.Collection)} if you want to override the existing values. *
* * @param requestedDocumentAttributes * A list of document fields/attributes to include in the response. You can limit the response to include * certain document fields. By default, all document fields are included in the response. * @return Returns a reference to this object so that method calls can be chained together. */ public RetrieveRequest withRequestedDocumentAttributes(String... requestedDocumentAttributes) { if (this.requestedDocumentAttributes == null) { setRequestedDocumentAttributes(new java.util.ArrayList* A list of document fields/attributes to include in the response. You can limit the response to include certain * document fields. By default, all document fields are included in the response. *
* * @param requestedDocumentAttributes * A list of document fields/attributes to include in the response. You can limit the response to include * certain document fields. By default, all document fields are included in the response. * @return Returns a reference to this object so that method calls can be chained together. */ public RetrieveRequest withRequestedDocumentAttributes(java.util.Collection* Overrides relevance tuning configurations of fields/attributes set at the index level. *
** 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. *
** 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. *
* * @return Overrides relevance tuning configurations of fields/attributes set at the index level. ** 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. *
*
* 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.
*/
public java.util.List
* Overrides relevance tuning configurations of fields/attributes set at the index level.
*
* 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.
*
* 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.
*
* 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. *
*
* 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.
*/
public void setDocumentRelevanceOverrideConfigurations(java.util.Collection
* Overrides relevance tuning configurations of fields/attributes set at the index level.
*
* 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.
*
* 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.
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setDocumentRelevanceOverrideConfigurations(java.util.Collection)} or
* {@link #withDocumentRelevanceOverrideConfigurations(java.util.Collection)} if you want to override the existing
* values.
*
* 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. *
*
* 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RetrieveRequest withDocumentRelevanceOverrideConfigurations(DocumentRelevanceConfiguration... documentRelevanceOverrideConfigurations) {
if (this.documentRelevanceOverrideConfigurations == null) {
setDocumentRelevanceOverrideConfigurations(new java.util.ArrayList
* Overrides relevance tuning configurations of fields/attributes set at the index level.
*
* 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.
*
* 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.
*
* 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. *
*
* 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RetrieveRequest withDocumentRelevanceOverrideConfigurations(
java.util.Collection
* Retrieved relevant passages are returned in pages the size of the
* Retrieved relevant passages are returned in pages the size of the
* Retrieved relevant passages are returned in pages the size of the
* Sets the number of retrieved relevant passages 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.
*
* Sets the number of retrieved relevant passages 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.
*
* Sets the number of retrieved relevant passages 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.
*
* The user context token or user and group information.
*
* The user context token or user and group information.
*
* The user context token or user and group information.
* PageSize
parameter. By default,
* Amazon Kendra returns the first page of results. Use this parameter to get result pages after the first one.
* PageSize
parameter. By
* default, Amazon Kendra returns the first page of results. Use this parameter to get result pages after the
* first one.
*/
public void setPageNumber(Integer pageNumber) {
this.pageNumber = pageNumber;
}
/**
* PageSize
parameter. By default,
* Amazon Kendra returns the first page of results. Use this parameter to get result pages after the first one.
* PageSize
parameter. By
* default, Amazon Kendra returns the first page of results. Use this parameter to get result pages after
* the first one.
*/
public Integer getPageNumber() {
return this.pageNumber;
}
/**
* PageSize
parameter. By default,
* Amazon Kendra returns the first page of results. Use this parameter to get result pages after the first one.
* PageSize
parameter. By
* default, Amazon Kendra returns the first page of results. Use this parameter to get result pages after the
* first one.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RetrieveRequest withPageNumber(Integer pageNumber) {
setPageNumber(pageNumber);
return this;
}
/**
*