Bird
0
0

You wrote this JSON to create an index:

medium📝 Debug Q6 of 15
Elasticsearch - Index Management
You wrote this JSON to create an index:
{ "settings": { "number_of_shards": 1, "number_of_replicas": 1 }, "mapping": { "properties": { "name": { "type": "keyword" } } } }

Why are the mappings not applied?
ABecause "type" keyword is invalid
BBecause "mapping" should be "mappings"
CBecause "number_of_replicas" cannot be 1
DBecause "properties" is missing
Step-by-Step Solution
Solution:
  1. Step 1: Check the JSON keys

    The key "mapping" is incorrect; it should be "mappings" in Elasticsearch.
  2. Step 2: Understand impact of wrong key

    Using "mapping" causes Elasticsearch to ignore the mappings section.
  3. Final Answer:

    Because "mapping" should be "mappings" -> Option B
  4. Quick Check:

    Correct key is "mappings" [OK]
Quick Trick: Use "mappings" not "mapping" for field definitions [OK]
Common Mistakes:
MISTAKES
  • Misspelling "mappings"
  • Wrong replica count assumptions
  • Misunderstanding "type" keyword usage

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes