Updating or removing a record in Elastic Search sometimes takes a second or so to fully make its way through the system such that a new search will show the change you made.
Is there some way to block the thread until elastic "verifies" that the requested operation has completed?
Specific example:
- User goes to detail page for an object
- User deletes that object, we delete from database and make request to elastic to delete it
- elastic returns 200 OK that the request was ok
- User is redirected back to a list page where we show elastic results, but the record is still showing
Usually after a second if you refresh it will be gone from elastic results as expected, but that amount of time is not deterministic. Is there some way to call an elastic operation such that it doesn't return a 200 OK until the operation has fully completed processing?
Only other way I can think to do this is to query elastic every Xms for the deleted object until elastic returns no result. This feels very hacky, anyone found a better solution to this use case?