Skip to content

Commit 151720c

Browse files
author
awstools
committedJun 22, 2023
feat(client-kendra): Introducing Amazon Kendra Retrieve API that can be used to retrieve relevant passages or text excerpts given an input query.
1 parent a9169d3 commit 151720c

File tree

10 files changed

+897
-122
lines changed

10 files changed

+897
-122
lines changed
 

‎clients/client-kendra/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,14 @@ Query
618618

619619
[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)
620620

621+
</details>
622+
<details>
623+
<summary>
624+
Retrieve
625+
</summary>
626+
627+
[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)
628+
621629
</details>
622630
<details>
623631
<summary>

‎clients/client-kendra/src/Kendra.ts

+13
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ import {
230230
PutPrincipalMappingCommandOutput,
231231
} from "./commands/PutPrincipalMappingCommand";
232232
import { QueryCommand, QueryCommandInput, QueryCommandOutput } from "./commands/QueryCommand";
233+
import { RetrieveCommand, RetrieveCommandInput, RetrieveCommandOutput } from "./commands/RetrieveCommand";
233234
import {
234235
StartDataSourceSyncJobCommand,
235236
StartDataSourceSyncJobCommandInput,
@@ -342,6 +343,7 @@ const commands = {
342343
ListThesauriCommand,
343344
PutPrincipalMappingCommand,
344345
QueryCommand,
346+
RetrieveCommand,
345347
StartDataSourceSyncJobCommand,
346348
StopDataSourceSyncJobCommand,
347349
SubmitFeedbackCommand,
@@ -1164,6 +1166,17 @@ export interface Kendra {
11641166
cb: (err: any, data?: QueryCommandOutput) => void
11651167
): void;
11661168

1169+
/**
1170+
* @see {@link RetrieveCommand}
1171+
*/
1172+
retrieve(args: RetrieveCommandInput, options?: __HttpHandlerOptions): Promise<RetrieveCommandOutput>;
1173+
retrieve(args: RetrieveCommandInput, cb: (err: any, data?: RetrieveCommandOutput) => void): void;
1174+
retrieve(
1175+
args: RetrieveCommandInput,
1176+
options: __HttpHandlerOptions,
1177+
cb: (err: any, data?: RetrieveCommandOutput) => void
1178+
): void;
1179+
11671180
/**
11681181
* @see {@link StartDataSourceSyncJobCommand}
11691182
*/

‎clients/client-kendra/src/KendraClient.ts

+3
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ import {
187187
PutPrincipalMappingCommandOutput,
188188
} from "./commands/PutPrincipalMappingCommand";
189189
import { QueryCommandInput, QueryCommandOutput } from "./commands/QueryCommand";
190+
import { RetrieveCommandInput, RetrieveCommandOutput } from "./commands/RetrieveCommand";
190191
import {
191192
StartDataSourceSyncJobCommandInput,
192193
StartDataSourceSyncJobCommandOutput,
@@ -284,6 +285,7 @@ export type ServiceInputTypes =
284285
| ListThesauriCommandInput
285286
| PutPrincipalMappingCommandInput
286287
| QueryCommandInput
288+
| RetrieveCommandInput
287289
| StartDataSourceSyncJobCommandInput
288290
| StopDataSourceSyncJobCommandInput
289291
| SubmitFeedbackCommandInput
@@ -354,6 +356,7 @@ export type ServiceOutputTypes =
354356
| ListThesauriCommandOutput
355357
| PutPrincipalMappingCommandOutput
356358
| QueryCommandOutput
359+
| RetrieveCommandOutput
357360
| StartDataSourceSyncJobCommandOutput
358361
| StopDataSourceSyncJobCommandOutput
359362
| SubmitFeedbackCommandOutput

‎clients/client-kendra/src/commands/QueryCommand.ts

+15-12
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,30 @@ export interface QueryCommandOutput extends QueryResult, __MetadataBearer {}
3636

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

0 commit comments

Comments
 (0)
Please sign in to comment.