Bird
Raised Fist0

Given this Elasticsearch query tuning snippet, what is the expected effect?

medium📝 Predict Output Q13 of Q15
Elasticsearch - Performance and Scaling
Given this Elasticsearch query tuning snippet, what is the expected effect?
{
  "query": {
    "match": { "title": "Elasticsearch" }
  },
  "size": 10,
  "timeout": "2s"
}
AReturns up to 10 matching documents or times out after 2 seconds.
BReturns exactly 2 documents matching the query.
CReturns all matching documents ignoring the size limit.
DCauses an error because timeout is not a valid parameter.
Step-by-Step Solution
Solution:
  1. Step 1: Understand query parameters

    Size limits results to 10 documents; timeout limits query time to 2 seconds.
  2. Step 2: Determine expected behavior

    The query returns up to 10 matches but stops if it takes longer than 2 seconds.
  3. Final Answer:

    Returns up to 10 matching documents or times out after 2 seconds. -> Option A
  4. Quick Check:

    Size 10 + timeout 2s = limited results [OK]
Quick Trick: Size limits hits; timeout limits query time [OK]
Common Mistakes:
MISTAKES
  • Assuming timeout limits number of results
  • Thinking size means minimum results
  • Believing timeout causes error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes