Each action in Bulk API consists of two JSON lines: first metadata (like index and id), then the document data.
Step 2: Check options for correct order and format
Combining metadata and data in one JSON object is invalid. The reversed order with data line before metadata line is wrong. Using a JSON array is invalid. {"index": {"_index": "test", "_id": "1"}}
{"field": "value"} correctly shows metadata line followed by data line.
Final Answer:
{"index": {"_index": "test", "_id": "1"}}
{"field": "value"} -> Option B
Quick Check:
Metadata line then data line = correct Bulk format [OK]
Quick Trick:Metadata line first, then data line in Bulk API [OK]
Common Mistakes:
MISTAKES
Swapping metadata and data lines
Using JSON arrays instead of lines
Combining metadata and data in one JSON object
Master "Document Operations" in Elasticsearch
9 interactive learning modes - each teaches the same concept differently