/* * 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 GetQuerySuggestionsRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The identifier of the index you want to get query suggestions from. *
*/ private String indexId; /** ** The text of a user's query to generate query suggestions. *
** A query is suggested if the query prefix matches what a user starts to type as their query. *
** Amazon Kendra does not show any suggestions if a user types fewer than two characters or more than 60 characters. * A query must also have at least one search result and contain at least one word of more than four characters. *
*/ private String queryText; /** ** The maximum number of query suggestions you want to show to your users. *
*/ private Integer maxSuggestionsCount; /** ** The suggestions type to base query suggestions on. The suggestion types are query history or document * fields/attributes. You can set one type or the other. *
** If you set query history as your suggestions type, Amazon Kendra suggests queries relevant to your users based on * popular queries in the query history. *
** If you set document fields/attributes as your suggestions type, Amazon Kendra suggests queries relevant to your * users based on the contents of document fields. *
*/ private java.util.List* Configuration information for the document fields/attributes that you want to base query suggestions on. *
*/ private AttributeSuggestionsGetConfig attributeSuggestionsConfig; /** ** The identifier of the index you want to get query suggestions from. *
* * @param indexId * The identifier of the index you want to get query suggestions from. */ public void setIndexId(String indexId) { this.indexId = indexId; } /** ** The identifier of the index you want to get query suggestions from. *
* * @return The identifier of the index you want to get query suggestions from. */ public String getIndexId() { return this.indexId; } /** ** The identifier of the index you want to get query suggestions from. *
* * @param indexId * The identifier of the index you want to get query suggestions from. * @return Returns a reference to this object so that method calls can be chained together. */ public GetQuerySuggestionsRequest withIndexId(String indexId) { setIndexId(indexId); return this; } /** ** The text of a user's query to generate query suggestions. *
** A query is suggested if the query prefix matches what a user starts to type as their query. *
** Amazon Kendra does not show any suggestions if a user types fewer than two characters or more than 60 characters. * A query must also have at least one search result and contain at least one word of more than four characters. *
* * @param queryText * The text of a user's query to generate query suggestions. ** A query is suggested if the query prefix matches what a user starts to type as their query. *
** Amazon Kendra does not show any suggestions if a user types fewer than two characters or more than 60 * characters. A query must also have at least one search result and contain at least one word of more than * four characters. */ public void setQueryText(String queryText) { this.queryText = queryText; } /** *
* The text of a user's query to generate query suggestions. *
** A query is suggested if the query prefix matches what a user starts to type as their query. *
** Amazon Kendra does not show any suggestions if a user types fewer than two characters or more than 60 characters. * A query must also have at least one search result and contain at least one word of more than four characters. *
* * @return The text of a user's query to generate query suggestions. ** A query is suggested if the query prefix matches what a user starts to type as their query. *
** Amazon Kendra does not show any suggestions if a user types fewer than two characters or more than 60 * characters. A query must also have at least one search result and contain at least one word of more than * four characters. */ public String getQueryText() { return this.queryText; } /** *
* The text of a user's query to generate query suggestions. *
** A query is suggested if the query prefix matches what a user starts to type as their query. *
** Amazon Kendra does not show any suggestions if a user types fewer than two characters or more than 60 characters. * A query must also have at least one search result and contain at least one word of more than four characters. *
* * @param queryText * The text of a user's query to generate query suggestions. ** A query is suggested if the query prefix matches what a user starts to type as their query. *
** Amazon Kendra does not show any suggestions if a user types fewer than two characters or more than 60 * characters. A query must also have at least one search result and contain at least one word of more than * four characters. * @return Returns a reference to this object so that method calls can be chained together. */ public GetQuerySuggestionsRequest withQueryText(String queryText) { setQueryText(queryText); return this; } /** *
* The maximum number of query suggestions you want to show to your users. *
* * @param maxSuggestionsCount * The maximum number of query suggestions you want to show to your users. */ public void setMaxSuggestionsCount(Integer maxSuggestionsCount) { this.maxSuggestionsCount = maxSuggestionsCount; } /** ** The maximum number of query suggestions you want to show to your users. *
* * @return The maximum number of query suggestions you want to show to your users. */ public Integer getMaxSuggestionsCount() { return this.maxSuggestionsCount; } /** ** The maximum number of query suggestions you want to show to your users. *
* * @param maxSuggestionsCount * The maximum number of query suggestions you want to show to your users. * @return Returns a reference to this object so that method calls can be chained together. */ public GetQuerySuggestionsRequest withMaxSuggestionsCount(Integer maxSuggestionsCount) { setMaxSuggestionsCount(maxSuggestionsCount); return this; } /** ** The suggestions type to base query suggestions on. The suggestion types are query history or document * fields/attributes. You can set one type or the other. *
** If you set query history as your suggestions type, Amazon Kendra suggests queries relevant to your users based on * popular queries in the query history. *
** If you set document fields/attributes as your suggestions type, Amazon Kendra suggests queries relevant to your * users based on the contents of document fields. *
* * @return The suggestions type to base query suggestions on. The suggestion types are query history or document * fields/attributes. You can set one type or the other. ** If you set query history as your suggestions type, Amazon Kendra suggests queries relevant to your users * based on popular queries in the query history. *
*
* If you set document fields/attributes as your suggestions type, Amazon Kendra suggests queries relevant
* to your users based on the contents of document fields.
* @see SuggestionType
*/
public java.util.List
* The suggestions type to base query suggestions on. The suggestion types are query history or document
* fields/attributes. You can set one type or the other.
*
* If you set query history as your suggestions type, Amazon Kendra suggests queries relevant to your users based on
* popular queries in the query history.
*
* If you set document fields/attributes as your suggestions type, Amazon Kendra suggests queries relevant to your
* users based on the contents of document fields.
*
* If you set query history as your suggestions type, Amazon Kendra suggests queries relevant to your users * based on popular queries in the query history. *
*
* If you set document fields/attributes as your suggestions type, Amazon Kendra suggests queries relevant to
* your users based on the contents of document fields.
* @see SuggestionType
*/
public void setSuggestionTypes(java.util.Collection
* The suggestions type to base query suggestions on. The suggestion types are query history or document
* fields/attributes. You can set one type or the other.
*
* If you set query history as your suggestions type, Amazon Kendra suggests queries relevant to your users based on
* popular queries in the query history.
*
* If you set document fields/attributes as your suggestions type, Amazon Kendra suggests queries relevant to your
* users based on the contents of document fields.
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSuggestionTypes(java.util.Collection)} or {@link #withSuggestionTypes(java.util.Collection)} if you
* want to override the existing values.
*
* If you set query history as your suggestions type, Amazon Kendra suggests queries relevant to your users * based on popular queries in the query history. *
*
* If you set document fields/attributes as your suggestions type, Amazon Kendra suggests queries relevant to
* your users based on the contents of document fields.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SuggestionType
*/
public GetQuerySuggestionsRequest withSuggestionTypes(String... suggestionTypes) {
if (this.suggestionTypes == null) {
setSuggestionTypes(new java.util.ArrayList
* The suggestions type to base query suggestions on. The suggestion types are query history or document
* fields/attributes. You can set one type or the other.
*
* If you set query history as your suggestions type, Amazon Kendra suggests queries relevant to your users based on
* popular queries in the query history.
*
* If you set document fields/attributes as your suggestions type, Amazon Kendra suggests queries relevant to your
* users based on the contents of document fields.
*
* If you set query history as your suggestions type, Amazon Kendra suggests queries relevant to your users * based on popular queries in the query history. *
*
* If you set document fields/attributes as your suggestions type, Amazon Kendra suggests queries relevant to
* your users based on the contents of document fields.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SuggestionType
*/
public GetQuerySuggestionsRequest withSuggestionTypes(java.util.Collection
* The suggestions type to base query suggestions on. The suggestion types are query history or document
* fields/attributes. You can set one type or the other.
*
* If you set query history as your suggestions type, Amazon Kendra suggests queries relevant to your users based on
* popular queries in the query history.
*
* If you set document fields/attributes as your suggestions type, Amazon Kendra suggests queries relevant to your
* users based on the contents of document fields.
*
* If you set query history as your suggestions type, Amazon Kendra suggests queries relevant to your users * based on popular queries in the query history. *
*
* If you set document fields/attributes as your suggestions type, Amazon Kendra suggests queries relevant to
* your users based on the contents of document fields.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SuggestionType
*/
public GetQuerySuggestionsRequest withSuggestionTypes(SuggestionType... suggestionTypes) {
java.util.ArrayList
* Configuration information for the document fields/attributes that you want to base query suggestions on.
*
* Configuration information for the document fields/attributes that you want to base query suggestions on.
*
* Configuration information for the document fields/attributes that you want to base query suggestions on.
*