Search code examples
azure-cognitive-search

are fields updated atomically once a merge is indexed


The documentation clearly states that once a merge is accepted, it is durable and will be indexed shortly. What's not clear is the atomicity of the indexing. I am assuming that all merged fields for a specific document are updated atomically (all or nothing) but just thought I'd confirm.

So assuming we create the index with 3 fields a, b, and c and a document with key="k1" is already indexed with the following values: { a:1, b:1, c:1 }

After the following merge is submitted { b:2, c:2 } for k1, subsequent queries for k1 will either return:

{ a:1, b:1, c:1 } or eventually { a:1, b:2, c:2 } but never { a:1, b:2, c:1 }

Is that a correct assumption?


Solution

  • Yes, the assumption is correct, for a given merge request all fields within a single document will be updated atomically.

    For completeness, note that updates across different entries in an indexing batch (targeted at different documents or even referencing the same document multiple times) are not guaranteed to be atomic.