Bird
0
0

Which of the following is the correct JSON structure for a document in Elasticsearch?

easy📝 Syntax Q3 of 15
Elasticsearch - Document Operations
Which of the following is the correct JSON structure for a document in Elasticsearch?
A"title": "Book", "author": "Alice"
B{"title": "Book", "author": "Alice"}
C["title", "Book", "author", "Alice"]
D<document><title>Book</title><author>Alice</author></document>
Step-by-Step Solution
Solution:
  1. Step 1: Recognize JSON object format

    Elasticsearch documents use JSON objects with key-value pairs inside curly braces.
  2. Step 2: Check each option

    A is an invalid JSON fragment; B is an array/list; D is XML; C is the valid JSON object.
  3. Final Answer:

    {"title": "Book", "author": "Alice"} -> Option B
  4. Quick Check:

    Valid JSON object = C [OK]
Quick Trick: Documents are JSON objects with key-value pairs [OK]
Common Mistakes:
MISTAKES
  • Using arrays instead of objects
  • Omitting curly braces
  • Confusing JSON with XML

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes