Bird
Raised Fist0

What will be the result of this Elasticsearch query?

medium📝 Predict Output Q5 of Q15
Elasticsearch - Performance and Scaling
What will be the result of this Elasticsearch query?
{"query": {"term": {"status": "active"}}, "track_total_hits": false}

Assuming there are 1000 matching documents, what does track_total_hits": false do?
ALimits results to 10 hits by default
BReturns hits without counting total matches for faster response
CCounts total hits exactly and returns them
DReturns an error due to invalid parameter
Step-by-Step Solution
Solution:
  1. Step 1: Understand track_total_hits parameter

    track_total_hits=false disables exact counting of total hits to improve performance.
  2. Step 2: Effect on query response

    Query returns hits but total hits count is approximate or omitted for speed.
  3. Final Answer:

    Returns hits without counting total matches for faster response -> Option B
  4. Quick Check:

    track_total_hits=false disables exact hit counting [OK]
Quick Trick: Disable total hits counting to speed up queries [OK]
Common Mistakes:
MISTAKES
  • Expecting an error from track_total_hits=false
  • Assuming total hits are always counted
  • Confusing with size parameter

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes