Does "_version" of a document will always map to a unique combination of "_seq_no" and "_primary_term"? Or multiple "_version" of the doc can have same combination of "_seq_no" and "_primary_term"?
Context:
From ES 7, the index API no longer takes in the version but instead expects _seq_no and _primary_term to be passed. In our contracts, we were sending the version to our clients and whenever they wanted to update the document they had to send the version back.
Now since that is no more supported, we were thinking of the following approach:
Client gives the version which he wants to edit.
We get the current document and match the version with the one provided. If the version matches, we pick the _seq_no and _primary_term from the current document and issue an edit on the same.
For the above approach to work, it is essential that every version uniquely maps to _seq_no and _primary_term
I hope that this comment addresses your question, particularly this sentence:
To be clear, the _version field continues not to uniquely identify a particular version of a document; if you need to do this then you should move to using the _seq_no and _primary_term fields.
The doc still says internal - Only index the document if the given version is identical to the version of the stored document.
Which is not valid anymore. Or is there a way to still issue a write on internal version (if it is acceptable by the developer, even if it doesn't work in corner cases)
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.