Bird
0
0

You wrote this Elasticsearch query but it returns an error:

medium📝 Debug Q6 of 15
Elasticsearch - Basics and Architecture
You wrote this Elasticsearch query but it returns an error:
{"query": {"match": {"name": Alice}}}

What is the likely cause?
AMissing quotes around the value 'Alice' causes invalid JSON.
BThe field name 'name' is not allowed in queries.
CThe match query requires a numeric value, not text.
DElasticsearch does not support match queries.
Step-by-Step Solution
Solution:
  1. Step 1: Check JSON syntax

    The value Alice is not in quotes, making the JSON invalid.
  2. Step 2: Understand JSON requirements

    String values must be enclosed in double quotes in JSON.
  3. Final Answer:

    Missing quotes around the value 'Alice' causes invalid JSON. -> Option A
  4. Quick Check:

    JSON string quoting = B [OK]
Quick Trick: Always quote string values in JSON queries [OK]
Common Mistakes:
MISTAKES
  • Forgetting quotes around string values
  • Assuming field names are restricted
  • Thinking match only works with numbers

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes