Bird
0
0

Given this Elasticsearch query:

medium📝 Predict Output Q13 of 15
Elasticsearch - Basic Search Queries
Given this Elasticsearch query:
{ "query": { "term": { "status": "active" } } }

What documents will this query return?
ADocuments where the status field exactly equals "active"
BDocuments where the status field contains the word "active" anywhere
CDocuments where the status field starts with "active"
DDocuments where the status field is analyzed and matches "active"
Step-by-Step Solution
Solution:
  1. Step 1: Understand term query behavior on field

    The term query matches documents where the field value exactly equals the given term without analysis.
  2. Step 2: Analyze each option

    Only Documents where the status field exactly equals "active" correctly describes exact equality. Others describe partial or analyzed matches which term query does not do.
  3. Final Answer:

    Documents where the status field exactly equals "active" -> Option A
  4. Quick Check:

    Term query = exact field value match [OK]
Quick Trick: Term query matches exact field value only [OK]
Common Mistakes:
MISTAKES
  • Thinking term query matches partial or analyzed text
  • Assuming term query matches prefixes or substrings
  • Confusing term query with match query behavior

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes