Versioning of Content


I'm trying to understand the impact of versioning in elastic when I index a content.

What I need is to keep only the latest version of a content and its respective indexed data for term/search filtering.

When I index the same content again with same ID (NOT UPDATE), a new version is created. But does ES keep only the new version or does keep old version as well? My understanding is it keeps only the new version and it does not impact the size of index as long as the old and the new
content is same.

:slight_smile: A query may come why I'm indexing the same content, but it is the scenario as content come by context and can overlap across contexts. Many threads do parallel process and index against my index. I don't need to keep context though for querying.

Similar discussed item..

It only keeps the new version, so essentially it's an in-place update.

Although Elasticsearch keeps only the new version of a document, and this is the only version accessible, old versions are not necessarily immediately deleted from disk. As all segments in Lucene are immutable, deleted or old versions of documents will remain in segments until these segments are part of a merge.