OpenSearch index change not reflected in search

782 views Asked by At

When we delete an item form the cache and then immediate do a search the search does not reflect the recent deletion.  

The search happens immediately after the index deletion or update.

How can I fix this? I don't see an aws configuration setting that will ensure the index is updated fully before returning.

1

There are 1 answers

0
M Akin On BEST ANSWER

I was able to get it fixed by adding the "?refresh=wait_for" on the query string.

like DELETE /invoices/306?refresh=wait_for

This is a link to the ElasticSearch version of this problem here is a link to the OpenSearch docs. Pay attention to the refresh paramater. and