Bird
0
0

Which of the following correctly represents an update action in the Elasticsearch Bulk API request body?

easy📝 Syntax Q3 of 15
Elasticsearch - Document Operations
Which of the following correctly represents an update action in the Elasticsearch Bulk API request body?
A{"update": {"_index": "users", "_id": "42"}} {"doc": {"age": 30}}
B{"update": {"_index": "users", "_id": "42"}} {"age": 30}
C{"doc": {"age": 30}} {"update": {"_index": "users", "_id": "42"}}
D{"index": {"_index": "users", "_id": "42"}} {"doc": {"age": 30}}
Step-by-Step Solution
Solution:
  1. Step 1: Review Bulk API update syntax

    Update actions require two lines: an action line and a source line with "doc" containing partial fields.
  2. Step 2: Validate options

    {"update": {"_index": "users", "_id": "42"}} {"doc": {"age": 30}} correctly shows the update action line followed by the partial document under "doc".
  3. Final Answer:

    {"update": {"_index": "users", "_id": "42"}} {"doc": {"age": 30}} -> Option A
  4. Quick Check:

    Update needs "doc" field [OK]
Quick Trick: Update actions require 'doc' field in second line [OK]
Common Mistakes:
MISTAKES
  • Omitting the 'doc' wrapper in update body
  • Swapping order of action and data lines
  • Using 'index' action instead of 'update' for partial updates

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes