Andrea Pinti
Andrea Pinti

Reputation: 123

AWS Kendra get _document_body attribute

I'm trying to query aws kendra but I need to have the document_body in the ResultItem response.

I tried with the RequestedDocumentAttributes param in the QueryCommand but the result still not contains the document body.

const command = new QueryCommand({
    IndexId: 'xxxxxxx',
    QueryText: "How to connect to ec2?",
    RequestedDocumentAttributes: [
        "_document_body",
        "_data_source_id",
        "_last_updated_at"
    ]    
});

Any suggestion?

Upvotes: 0

Views: 640

Answers (1)

Kevin Li
Kevin Li

Reputation: 14

_document_body is a special field and Kendra currently does not support returning its entire value in the Query response. Kendra does returns a DocumentExcept for each document ResultItem, which contains the most relevant extract of text in the _document_body.

Upvotes: 0

Related Questions