Bird
0
0

Given the following Bulk API request body, what will happen?

medium📝 Predict Output Q13 of 15
Elasticsearch - Document Operations
Given the following Bulk API request body, what will happen?
{"index": {"_index": "products", "_id": "10"}}
{"name": "Laptop", "price": 1200}
{"delete": {"_index": "products", "_id": "5"}}
{"index": {"_index": "products", "_id": "11"}}
{"name": "Mouse", "price": 25}
AAdds two documents and deletes one document
BAdds three documents
CDeletes two documents
DSyntax error due to missing data line for delete
Step-by-Step Solution
Solution:
  1. Step 1: Analyze each Bulk API action

    First action: index document with id 10 (add Laptop). Second action: delete document with id 5 (no data line needed). Third action: index document with id 11 (add Mouse).
  2. Step 2: Confirm correct syntax and operations

    Delete action does not require a data line, so no syntax error. Two documents are added, one deleted.
  3. Final Answer:

    Adds two documents and deletes one document -> Option A
  4. Quick Check:

    Index + delete + index = add 2, delete 1 [OK]
Quick Trick: Delete action needs no data line in Bulk API [OK]
Common Mistakes:
MISTAKES
  • Expecting data line after delete action
  • Counting delete as add
  • Confusing action order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes