The time for which elasticsearch keeps information about deleted documents is controlled by index.gc_deletes
parameter. By default this time is 1m
. So, theoretically, you can decrease this time to 0s
, wait for a second, delete the document, index a new document with the same version, and set index.gc_deletes
back to 1m
. But at the moment that would work only on master due to a bug. If you are using older version of elasticsearch, you will not be able to change index.gc_deletes
without closing the index first.
There is a good blog post on elasticsearch.org web site that describes how versions are handled by elasticsearch in details.