Bird
0
0

This Elasticsearch query returns no results: {"query": {"match": {"status": "active"}}} But you know documents have 'status' field with value 'Active'. What is the likely issue?

medium📝 Debug Q7 of 15
Elasticsearch - Index Management
This Elasticsearch query returns no results: {"query": {"match": {"status": "active"}}} But you know documents have 'status' field with value 'Active'. What is the likely issue?
AThe field 'status' is missing in the index mapping
BThe match query is case sensitive and 'active' != 'Active'
CThe query syntax is incorrect
DElasticsearch does not support match queries on text fields
Step-by-Step Solution
Solution:
  1. Step 1: Understand match query case sensitivity

    Match queries analyze text and are case sensitive depending on mapping and analyzer.
  2. Step 2: Identify mismatch in case

    The query searches for 'active' lowercase but documents have 'Active' capitalized, causing no matches.
  3. Final Answer:

    The match query is case sensitive and 'active' != 'Active' -> Option B
  4. Quick Check:

    Match queries can be case sensitive depending on analyzer [OK]
Quick Trick: Check case sensitivity in match queries [OK]
Common Mistakes:
MISTAKES
  • Ignoring case differences in text queries
  • Assuming match queries always ignore case
  • Thinking query syntax is wrong without checking data

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes