Bird
0
0

Which of the following is the correct syntax to update a document with version 3 using the Elasticsearch REST API?

easy📝 Syntax Q3 of 15
Elasticsearch - Document Operations
Which of the following is the correct syntax to update a document with version 3 using the Elasticsearch REST API?
APUT /index/_doc/1 {"field":"value", "version":3}
BPOST /index/_update/1?version=3 {"doc":{"field":"value"}}
CPOST /index/_doc/1?version=3 {"field":"value"}
DGET /index/_doc/1?version=3
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct update syntax with version

    Elasticsearch updates use POST to _update endpoint with version as query parameter.
  2. Step 2: Check payload format

    Update requests require a "doc" object with fields to update.
  3. Final Answer:

    POST /index/_update/1?version=3 {"doc":{"field":"value"}} -> Option B
  4. Quick Check:

    Update with version uses POST _update + doc [OK]
Quick Trick: Use POST _update with doc and version query param [OK]
Common Mistakes:
MISTAKES
  • Using PUT with version in body
  • Using GET for update
  • Missing doc wrapper in update body

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes