Complete the code to specify the version number when indexing a document.
POST /my_index/_doc/1?version=[1] { "name": "Alice" }
The version number must be set to the current version of the document, which starts at 1.
Complete the code to update a document only if the version matches.
POST /my_index/_doc/1/_update?version=[1] { "doc": {"age": 30} }
To update safely, specify the current version number, here 2.
Fix the error in the code to prevent version conflicts when deleting a document.
DELETE /my_index/_doc/1?version=[1]
The version must match the current document version, here 2, to avoid conflicts.
Fill both blanks to create a document with version control and refresh immediately.
PUT /my_index/_doc/2?version=[1]&refresh=[2] { "title": "New Doc" }
Use version 1 for a new document and set refresh to true to make it searchable immediately.
Fill all three blanks to update a document with version check, retry on conflict, and refresh.
POST /my_index/_doc/3/_update?version=[1]&retry_on_conflict=[2]&refresh=[3] { "doc": {"status": "active"} }
Use the current version 3, retry 5 times on conflict, and refresh immediately.