Remove old document versions


(Ammo) #1

Hi,
i am currently writing a script which makes use of update by query.
I am trying to remove a field in all indices and documents older than 7 days.
I can see in Kibana that it is working. But i think the information are still stored in elasticserach because i heard that update by query creates a new version of the updated document.
My questions are:

  1. Is this correct?
  2. If yes, how can i remove older versions of document or how can i update without creating new versions of documents.

Regards, Ahmet


(Zachary Tong) #2

Internally, updates do indeed create a new version of the document and then overwrites it. The old document is marked for deletion and eventually purged.

Practically, you don't need to worry about this... it's all an internal implementation detail. From the application's point of view, once updated the old version of the document is not accessible anymore. Internally it will be cleaned up at some point and removed.


(Ammo) #3

Thank you very much :+1::slight_smile:


(system) #4

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