In a concurrent system, I believe I understand optimistic locking and passing the version query string parameter along. However, that is only if the document exists. I.e. you can't send ?version=0. What is the equivalent of optimistic locking for the initial indexing of a document?
If I'm reading the documentation correctly that is only when not specifying an id. Which in our system we have our own ids. It that how you understand how createdocument works as well?
If you send without an ID the document should always get created as no collisions can occur. This is for then you do specify an external ID. The following should show this:
# Create initial version
POST /test/_create/1
{
"VERSION": 1
}
# Should fail
POST /test/_create/1
{
"VERSION": 2
}
# Here we specify type and this should work
POST /test/_doc/1
{
"VERSION": 2
}
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.