Bird
0
0

You wrote a query but all documents have a _score of 0. What is the most likely cause?

medium📝 Debug Q6 of 15
Elasticsearch - Search Results and Scoring
You wrote a query but all documents have a _score of 0. What is the most likely cause?
AYou used a <code>filter</code> clause instead of <code>must</code>
BYou forgot to specify the index
CYour documents are empty
DYou used a <code>match</code> query
Step-by-Step Solution
Solution:
  1. Step 1: Understand filter vs must clauses

    Filters do not calculate relevance scores; they only include/exclude documents, so _score is zero.
  2. Step 2: Check other options

    Forgetting index causes errors, empty docs don't affect score directly, and match queries produce scores.
  3. Final Answer:

    You used a filter clause instead of must -> Option A
  4. Quick Check:

    filter clause = _score zero [OK]
Quick Trick: Filters exclude scoring; use must for scoring queries [OK]
Common Mistakes:
MISTAKES
  • Using filter when scoring is needed
  • Assuming empty docs cause zero score
  • Confusing query types

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes