Bird
0
0

Which of the following is the correct way to specify a version when updating a document in Elasticsearch?

easy📝 Syntax Q12 of 15
Elasticsearch - Document Operations
Which of the following is the correct way to specify a version when updating a document in Elasticsearch?
APOST /index/_update/1?version=3 { "doc": {"field": "value"} }
BPOST /index/_update/1 { "doc": {"field": "value"}, "version_number": 3 }
CPOST /index/_update/1 { "doc": {"field": "value"}, "ver": 3 }
DPOST /index/_update/1 { "doc": {"field": "value"}, "version": 3 }
Step-by-Step Solution
Solution:
  1. Step 1: Recall Elasticsearch update syntax with version

    The version parameter is passed as a query parameter, not inside the JSON body.
  2. Step 2: Identify correct syntax

    POST /index/_update/1?version=3 { "doc": {"field": "value"} } uses ?version=3 in the URL, which is the correct way to specify version for update.
  3. Final Answer:

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

    Version is a query parameter, not in body [OK]
Quick Trick: Use ?version=number in URL, not inside JSON body [OK]
Common Mistakes:
MISTAKES
  • Putting version inside JSON body
  • Using wrong parameter names like ver or version_number
  • Omitting the version parameter

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes