Bird
0
0

You want to update multiple documents partially in a single Bulk API request. Which of the following correctly shows how to specify an update action with partial fields?

hard🚀 Application Q8 of 15
Elasticsearch - Document Operations
You want to update multiple documents partially in a single Bulk API request. Which of the following correctly shows how to specify an update action with partial fields?
A{"update": {"_index": "orders", "_id": "200"}} {"status": "shipped", "tracking": "12345"}
B{"update": {"_index": "orders", "_id": "200"}} {"doc": {"status": "shipped", "tracking": "12345"}}
C{"index": {"_index": "orders", "_id": "200"}} {"status": "shipped", "tracking": "12345"}
D{"update": {"_index": "orders"}} {"doc": {"status": "shipped", "tracking": "12345"}}
Step-by-Step Solution
Solution:
  1. Step 1: Understand update action format

    Update requires an action line with _index and _id, followed by a line with "doc" containing partial fields.
  2. Step 2: Evaluate options

    {"update": {"_index": "orders", "_id": "200"}} {"doc": {"status": "shipped", "tracking": "12345"}} correctly includes _id and wraps partial fields inside "doc".
  3. Final Answer:

    {"update": {"_index": "orders", "_id": "200"}} {"doc": {"status": "shipped", "tracking": "12345"}} -> Option B
  4. Quick Check:

    Partial updates require 'doc' and _id [OK]
Quick Trick: Partial updates need 'doc' and document _id [OK]
Common Mistakes:
MISTAKES
  • Omitting 'doc' wrapper for partial updates
  • Using 'index' instead of 'update' for partial changes
  • Missing _id in update action

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes