Delete is real-time or not?

Is it possible that after Delete operation executed the object can be still searchable (can be returned from Search and Get operations) for some period of time?

Delete operation has optional refresh parameter:
Does it mean the Delete is not a real-time operation?

According to Elastic Documentation:

"Document changes are not visible to search immediately, but will become visible within 1 second. This is why we say that Elasticsearch has near real-time search"

So technically, it is possible that after a delete, an object can be still searchable.

Can "Get" operation also return just deleted object?

I cannot awnser that for sure, but since the object is searchable, I don't see a reason why wouldn't it be able to get the document, if it was deleted in almost the same time the 'Get' was called.

I mean, isn't it almost the same thing? Only for different uses.

Edit: I've tried to do that, and it is possible to get a document after it was deleted, but it not really easy to do that.

1 Like

Getting a document by id does not require a refresh so is real time. Any kind of search operation does require refresh.

1 Like

Old discussion:

So after the document is updated it disappeared from searches until the update is indexed.

As far as I understand the explanation is here:

From the "Versioning support":
Internally, Elasticsearch has marked the old document as deleted and added an entirely new document. The old version of the document doesn’t disappear immediately, although you won’t be able to access it. Elasticsearch cleans up deleted documents in the background as you continue to index more data.

I hoped after you deleted the document it is also "marked as old" and immediately disappeared from searches.

Could you please double check if delete really requires extra refresh to affect searches.

I mean, I wasn't able to do anything in that document, so it doesn't really matter

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.