Optional
attributeCleans the result text by replacing sequences of whitespace with a single space and removing ellipses.
The result text to clean.
The cleaned result text.
Combines title and excerpt into a single string.
Optional
title: stringThe title of the document.
Optional
excerpt: stringAn excerpt from the document.
A single string combining the title and excerpt.
Converts a QueryResultItem object into a Document object.
The QueryResultItem object to convert.
A Document object.
Converts a RetrieveResultItem object into a Document object.
The RetrieveResultItem object to convert.
A Document object.
Extracts the attribute key-value pairs from an array of DocumentAttribute objects.
Optional
documentAttributes: DocumentAttribute[]The array of DocumentAttribute objects to extract the key-value pairs from.
An object containing the extracted attribute key-value pairs.
Extracts the attribute value from a DocumentAttributeValue object.
The DocumentAttributeValue object to extract the value from.
The extracted attribute value.
Extracts the top-k documents from a QueryCommandOutput object.
The QueryCommandOutput object to extract the documents from.
The number of documents to extract.
An array of Document objects.
Extracts the excerpt text from a QueryResultItem object.
The QueryResultItem object to extract the excerpt text from.
The extracted excerpt text.
Extracts the top-k documents from a RetrieveCommandOutput object.
The RetrieveCommandOutput object to extract the documents from.
The number of documents to extract.
An array of Document objects.
Sends a retrieve or query request to Kendra and returns the top-k documents.
The query to send to Kendra.
The number of top documents to return.
Optional
attributeFilter: AttributeFilterOptional filter to apply when retrieving documents.
A Promise that resolves to an array of Document objects.
Static
lc_
Class for interacting with Amazon Kendra, an intelligent search service provided by AWS. Extends the BaseRetriever class.
Example