Bird
Raised Fist0

What will be the result of this saved search filter?

medium📝 Predict Output Q5 of Q15
Elasticsearch - Kibana and Visualization
What will be the result of this saved search filter?
{"query": {"bool": {"filter": [{"term": {"status": "sold"}}, {"term": {"status": "available"}}]}}}
AOnly documents with status 'available' will match
BNo documents will match because status cannot be both 'sold' and 'available'
COnly documents with status 'sold' will match
DDocuments with status 'sold' or 'available' will match
Step-by-Step Solution
Solution:
  1. Step 1: Understand filter logic

    Filters inside bool filter combine with AND logic, so both must be true.
  2. Step 2: Analyze conflicting conditions

    Status cannot be both 'sold' and 'available' simultaneously, so no matches.
  3. Final Answer:

    No documents will match because status cannot be both 'sold' and 'available' -> Option B
  4. Quick Check:

    AND filter with conflicting terms = no matches [OK]
Quick Trick: Filters in bool filter combine with AND, conflicting terms yield no results [OK]
Common Mistakes:
MISTAKES
  • Assuming filters combine with OR logic
  • Thinking one filter overrides the other
  • Ignoring filter combination logic

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes