Bird
0
0

Given this mapping with dynamic set to 'strict':

medium📝 Predict Output Q4 of 15
Elasticsearch - Mappings and Data Types
Given this mapping with dynamic set to 'strict':
{"mappings": {"dynamic": "strict", "properties": {"name": {"type": "text"}}}}

What happens if you index a document with a new field age?
AThe document is rejected with a mapping exception error.
BThe new field is added dynamically with guessed type.
CThe new field is ignored and not indexed.
DThe document is indexed but the new field is stored as text.
Step-by-Step Solution
Solution:
  1. Step 1: Understand 'strict' dynamic mapping behavior

    When dynamic is set to 'strict', Elasticsearch rejects documents with unknown fields.
  2. Step 2: Effect of indexing a document with new field

    Since 'age' is not in mapping, indexing fails with an error.
  3. Final Answer:

    The document is rejected with a mapping exception error. -> Option A
  4. Quick Check:

    Dynamic 'strict' = reject unknown fields [OK]
Quick Trick: Dynamic 'strict' rejects unknown fields during indexing [OK]
Common Mistakes:
MISTAKES
  • Assuming new fields are added automatically
  • Thinking new fields are ignored silently
  • Believing new fields default to text type

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes