Skip to content

Commit

Permalink
feat(client-kendra): Introducing Amazon Kendra Retrieve API that can …
Browse files Browse the repository at this point in the history
…be used to retrieve relevant passages or text excerpts given an input query.
  • Loading branch information
awstools committed Jun 22, 2023
1 parent a9169d3 commit 151720c
Show file tree
Hide file tree
Showing 10 changed files with 897 additions and 122 deletions.
8 changes: 8 additions & 0 deletions clients/client-kendra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,14 @@ Query

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kendra/classes/querycommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kendra/interfaces/querycommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kendra/interfaces/querycommandoutput.html)

</details>
<details>
<summary>
Retrieve
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kendra/classes/retrievecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kendra/interfaces/retrievecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-kendra/interfaces/retrievecommandoutput.html)

</details>
<details>
<summary>
Expand Down
13 changes: 13 additions & 0 deletions clients/client-kendra/src/Kendra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ import {
PutPrincipalMappingCommandOutput,
} from "./commands/PutPrincipalMappingCommand";
import { QueryCommand, QueryCommandInput, QueryCommandOutput } from "./commands/QueryCommand";
import { RetrieveCommand, RetrieveCommandInput, RetrieveCommandOutput } from "./commands/RetrieveCommand";
import {
StartDataSourceSyncJobCommand,
StartDataSourceSyncJobCommandInput,
Expand Down Expand Up @@ -342,6 +343,7 @@ const commands = {
ListThesauriCommand,
PutPrincipalMappingCommand,
QueryCommand,
RetrieveCommand,
StartDataSourceSyncJobCommand,
StopDataSourceSyncJobCommand,
SubmitFeedbackCommand,
Expand Down Expand Up @@ -1164,6 +1166,17 @@ export interface Kendra {
cb: (err: any, data?: QueryCommandOutput) => void
): void;

/**
* @see {@link RetrieveCommand}
*/
retrieve(args: RetrieveCommandInput, options?: __HttpHandlerOptions): Promise<RetrieveCommandOutput>;
retrieve(args: RetrieveCommandInput, cb: (err: any, data?: RetrieveCommandOutput) => void): void;
retrieve(
args: RetrieveCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: RetrieveCommandOutput) => void
): void;

/**
* @see {@link StartDataSourceSyncJobCommand}
*/
Expand Down
3 changes: 3 additions & 0 deletions clients/client-kendra/src/KendraClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ import {
PutPrincipalMappingCommandOutput,
} from "./commands/PutPrincipalMappingCommand";
import { QueryCommandInput, QueryCommandOutput } from "./commands/QueryCommand";
import { RetrieveCommandInput, RetrieveCommandOutput } from "./commands/RetrieveCommand";
import {
StartDataSourceSyncJobCommandInput,
StartDataSourceSyncJobCommandOutput,
Expand Down Expand Up @@ -284,6 +285,7 @@ export type ServiceInputTypes =
| ListThesauriCommandInput
| PutPrincipalMappingCommandInput
| QueryCommandInput
| RetrieveCommandInput
| StartDataSourceSyncJobCommandInput
| StopDataSourceSyncJobCommandInput
| SubmitFeedbackCommandInput
Expand Down Expand Up @@ -354,6 +356,7 @@ export type ServiceOutputTypes =
| ListThesauriCommandOutput
| PutPrincipalMappingCommandOutput
| QueryCommandOutput
| RetrieveCommandOutput
| StartDataSourceSyncJobCommandOutput
| StopDataSourceSyncJobCommandOutput
| SubmitFeedbackCommandOutput
Expand Down
27 changes: 15 additions & 12 deletions clients/client-kendra/src/commands/QueryCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,30 @@ export interface QueryCommandOutput extends QueryResult, __MetadataBearer {}

/**
* @public
* <p>Searches an active index. Use this API to search your documents using query. The
* <code>Query</code> API enables to do faceted search and to filter results based on
* document attributes.</p>
* <p>It also enables you to provide user context that Amazon Kendra uses to enforce
* document access control in the search results.</p>
* <p>Amazon Kendra searches your index for text content and question and answer (FAQ)
* content. By default the response contains three types of results.</p>
* <p>Searches an index given an input query.</p>
* <p>You can configure boosting or relevance tuning at the query level to override boosting
* at the index level, filter based on document fields/attributes and faceted search, and
* filter based on the user or their group access to documents. You can also include certain
* fields in the response that might provide useful additional information.</p>
* <p>A query response contains three types of results.</p>
* <ul>
* <li>
* <p>Relevant passages</p>
* <p>Relevant suggested answers. The answers can be either a text excerpt or table
* excerpt. The answer can be highlighted in the excerpt.</p>
* </li>
* <li>
* <p>Matching FAQs</p>
* <p>Matching FAQs or questions-answer from your FAQ file.</p>
* </li>
* <li>
* <p>Relevant documents</p>
* <p>Relevant documents. This result type includes an excerpt of the document with
* the document title. The searched terms can be highlighted in the excerpt.</p>
* </li>
* </ul>
* <p>You can specify that the query return only one type of result using the
* <code>QueryResultTypeFilter</code> parameter.</p>
* <p>Each query returns the 100 most relevant results. </p>
* <code>QueryResultTypeFilter</code> parameter. Each query returns the 100
* most relevant results. If you filter result type to only question-answers,
* a maximum of four results are returned. If you filter result type to only
* answers, a maximum of three results are returned.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Loading

0 comments on commit 151720c

Please sign in to comment.