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.
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