Bird
0
0

Find the mistake in this Elasticsearch query:

medium📝 Debug Q7 of 15
Elasticsearch - Basics and Architecture

Find the mistake in this Elasticsearch query:

{ "query": { "term": { "status": ["active"] } } }
AThe field name <code>status</code> is invalid
BThe query is missing the <code>filter</code> wrapper
CThe query should use <code>match</code> instead of <code>term</code>
DThe <code>term</code> query does not accept an array as value
Step-by-Step Solution
Solution:
  1. Step 1: Understand term query value requirements

    term expects a single value, not an array.
  2. Step 2: Check other options

    Field name is valid, match is not required, and filter wrapper is optional.
  3. Final Answer:

    The term query does not accept an array as value -> Option D
  4. Quick Check:

    term needs single value, not array [OK]
Quick Trick: term query value must be a single item [OK]
Common Mistakes:
MISTAKES
  • Passing arrays to term query
  • Confusing term with terms query
  • Adding unnecessary wrappers

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes