How to enhance a document in Amazon Kendra

0

Hello, I am using Kendra as the indexer for a document processing solution. Initially when a document is scanned it is added to Kendra using BatchPutDocument, however at a later point I would like to "tag" or "enrich" the document with more attributes, so I can search that same document using these new attributes.

I don't see any updateDocument API available, the other option was to get the document, add attributes to it, delete the current entry with BatchDeleteDocument and upload the new enriched one; however the Query or Retrieve API do not return the complete document that was initially uploaded to Kendra with BatchPutDocument, so there is potential for losing valuable data.

Any ideas or suggestions are appreciated. Thank you.

asked 5 months ago238 views
1 Answer
0

Hi Juan,

To add new custom fields in your index you can use the UpdateIndex API with theDocumentMetadataConfigurationUpdates parameter. This allows you to update custom attribute relevant to your documents. Once you have updated the index configuration to include the new fields, re-upload the documents using the BatchPutDocument API, including the new attributes in the Attributes section of your documents.

Also depending on where your documents are stored, If your documents are in an S3 bucket, you can add new attributes through metadata JSON files in the S3 data source.

Thanks, Ayman

AWS
aykazmi
answered 4 months ago
  • Thanks for your reply Ayman, one clarification thou, when you refer to re-upload the documents using BatchPutDocument API, do you mean calling the API again only with the new attributes? or deleting the document and performing a new upload with all the document information including new attributes?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions