Skip to content

Commit

Permalink
feat(client-kendra): AWS Kendra now supports configuring document fie…
Browse files Browse the repository at this point in the history
…lds/attributes via the GetQuerySuggestions API. You can now base query suggestions on the contents of document fields.
  • Loading branch information
awstools committed May 2, 2023
1 parent f75bf2c commit 4e715d7
Show file tree
Hide file tree
Showing 7 changed files with 934 additions and 322 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export interface CreateQuerySuggestionsBlockListCommandOutput
* <code>CreateQuerySuggestionsBlockList</code> is currently not supported in the
* Amazon Web Services GovCloud (US-West) region.</p>
* <p>For an example of creating a block list for query suggestions using the
* Python SDK, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/query-suggestions.html#suggestions-block-list">Query
* Python SDK, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/query-suggestions.html#query-suggestions-blocklist">Query
* suggestions block list</a>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
Expand Down
108 changes: 107 additions & 1 deletion clients/client-kendra/src/commands/GetQuerySuggestionsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import {
} from "@aws-sdk/types";

import { KendraClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../KendraClient";
import { GetQuerySuggestionsRequest, GetQuerySuggestionsResponse } from "../models/models_0";
import { GetQuerySuggestionsResponse } from "../models/models_0";
import { GetQuerySuggestionsRequest } from "../models/models_1";
import { de_GetQuerySuggestionsCommand, se_GetQuerySuggestionsCommand } from "../protocols/Aws_json1_1";

/**
Expand Down Expand Up @@ -46,6 +47,111 @@ export interface GetQuerySuggestionsCommandOutput extends GetQuerySuggestionsRes
* IndexId: "STRING_VALUE", // required
* QueryText: "STRING_VALUE", // required
* MaxSuggestionsCount: Number("int"),
* SuggestionTypes: [ // SuggestionTypes
* "QUERY" || "DOCUMENT_ATTRIBUTES",
* ],
* AttributeSuggestionsConfig: { // AttributeSuggestionsGetConfig
* SuggestionAttributes: [ // DocumentAttributeKeyList
* "STRING_VALUE",
* ],
* AdditionalResponseAttributes: [
* "STRING_VALUE",
* ],
* AttributeFilter: { // AttributeFilter
* AndAllFilters: [ // AttributeFilterList
* {
* AndAllFilters: [
* "<AttributeFilter>",
* ],
* OrAllFilters: [
* "<AttributeFilter>",
* ],
* NotFilter: "<AttributeFilter>",
* EqualsTo: { // DocumentAttribute
* Key: "STRING_VALUE", // required
* Value: { // DocumentAttributeValue
* StringValue: "STRING_VALUE",
* StringListValue: [ // DocumentAttributeStringListValue
* "STRING_VALUE",
* ],
* LongValue: Number("long"),
* DateValue: new Date("TIMESTAMP"),
* },
* },
* ContainsAll: {
* Key: "STRING_VALUE", // required
* Value: {
* StringValue: "STRING_VALUE",
* StringListValue: [
* "STRING_VALUE",
* ],
* LongValue: Number("long"),
* DateValue: new Date("TIMESTAMP"),
* },
* },
* ContainsAny: {
* Key: "STRING_VALUE", // required
* Value: {
* StringValue: "STRING_VALUE",
* StringListValue: [
* "STRING_VALUE",
* ],
* LongValue: Number("long"),
* DateValue: new Date("TIMESTAMP"),
* },
* },
* GreaterThan: {
* Key: "STRING_VALUE", // required
* Value: {
* StringValue: "STRING_VALUE",
* StringListValue: [
* "STRING_VALUE",
* ],
* LongValue: Number("long"),
* DateValue: new Date("TIMESTAMP"),
* },
* },
* GreaterThanOrEquals: {
* Key: "STRING_VALUE", // required
* Value: {
* StringValue: "STRING_VALUE",
* StringListValue: [
* "STRING_VALUE",
* ],
* LongValue: Number("long"),
* DateValue: new Date("TIMESTAMP"),
* },
* },
* LessThan: "<DocumentAttribute>",
* LessThanOrEquals: "<DocumentAttribute>",
* },
* ],
* OrAllFilters: [
* "<AttributeFilter>",
* ],
* NotFilter: "<AttributeFilter>",
* EqualsTo: "<DocumentAttribute>",
* ContainsAll: "<DocumentAttribute>",
* ContainsAny: "<DocumentAttribute>",
* GreaterThan: "<DocumentAttribute>",
* GreaterThanOrEquals: "<DocumentAttribute>",
* LessThan: "<DocumentAttribute>",
* LessThanOrEquals: "<DocumentAttribute>",
* },
* UserContext: { // UserContext
* Token: "STRING_VALUE",
* UserId: "STRING_VALUE",
* Groups: [ // Groups
* "STRING_VALUE",
* ],
* DataSourceGroups: [ // DataSourceGroups
* { // DataSourceGroup
* GroupId: "STRING_VALUE", // required
* DataSourceId: "STRING_VALUE", // required
* },
* ],
* },
* },
* };
* const command = new GetQuerySuggestionsCommand(input);
* const response = await client.send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export interface UpdateQuerySuggestionsConfigCommandOutput extends __MetadataBea
* <p>Updates the settings of query suggestions for an index.</p>
* <p>Amazon Kendra supports partial updates, so you only need to provide
* the fields you want to update.</p>
* <p>If an update is currently processing (i.e. 'happening'), you
* <p>If an update is currently processing, you
* need to wait for the update to finish before making another update.</p>
* <p>Updates to query suggestions settings might not take effect right away.
* The time for your updated settings to take effect depends on the updates
Expand All @@ -60,6 +60,15 @@ export interface UpdateQuerySuggestionsConfigCommandOutput extends __MetadataBea
* IncludeQueriesWithoutUserInformation: true || false,
* MinimumNumberOfQueryingUsers: Number("int"),
* MinimumQueryCount: Number("int"),
* AttributeSuggestionsConfig: { // AttributeSuggestionsUpdateConfig
* SuggestableConfigList: [ // SuggestableConfigList
* { // SuggestableConfig
* AttributeName: "STRING_VALUE",
* Suggestable: true || false,
* },
* ],
* AttributeSuggestionsMode: "ACTIVE" || "INACTIVE",
* },
* };
* const command = new UpdateQuerySuggestionsConfigCommand(input);
* const response = await client.send(command);
Expand Down
Loading

0 comments on commit 4e715d7

Please sign in to comment.