Bird
0
0

What does this Elasticsearch query return when run on an index?

medium📝 Predict Output Q5 of 15
Elasticsearch - Index Management
What does this Elasticsearch query return when run on an index?
{"query": {"term": {"status": "active"}}}
ADocuments with 'status' field containing 'Active' or 'active'
BDocuments containing the word 'active' anywhere in any field
CDocuments where the 'status' field exactly matches 'active'
DAll documents in the index regardless of 'status'
Step-by-Step Solution
Solution:
  1. Step 1: Understand the 'term' query

    The 'term' query matches exact values without analysis.
  2. Step 2: Analyze the query effect

    It returns documents where 'status' exactly equals 'active' (case-sensitive).
  3. Final Answer:

    Documents where the 'status' field exactly matches 'active' -> Option C
  4. Quick Check:

    'term' queries require exact matches [OK]
Quick Trick: 'term' query matches exact field values only [OK]
Common Mistakes:
MISTAKES
  • Confusing 'term' with 'match' query
  • Ignoring case sensitivity in 'term' queries
  • Assuming partial matches are returned

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes