Search code examples
elasticsearchmemorykibana

How update works in Elasticsearch?


I'm facing an optimization problem on update: I need to understand how the Elasticsearch update mechanics work with their documents in a low level view.

Is it true that Elasticsearch marks as deleted the previous record, without physically deleting it, and rewrites it to a new record, wasting more space than necessary?


Solution

  • Yes, ES uses Lucene under the hood.

    So update process is as follows high level

    1. Insert operation
    2. Marked older one for deletion - soft deletion
    3. When Lucene merges segments. It actually deletes the marked documents i.e tombstones.

    At high level, how does crud work in ES.