Bird
0
0

Given the query:

medium📝 Predict Output Q4 of 15
Elasticsearch - Basic Search Queries
Given the query:
{ "query": { "range": { "age": { "gte": 30, "lt": 40 } } } }
Which ages will be matched?
AAges 30 to 39 inclusive
BAges 30 to 40 inclusive
CAges 31 to 39 inclusive
DAges 31 to 40 inclusive
Step-by-Step Solution
Solution:
  1. Step 1: Understand the operators used

    gte means 'greater than or equal to' 30, lt means 'less than' 40.
  2. Step 2: Determine the range of matched ages

    So ages from 30 up to but not including 40 are matched, i.e., 30 to 39 inclusive.
  3. Final Answer:

    Ages 30 to 39 inclusive -> Option A
  4. Quick Check:

    gte + lt means inclusive lower, exclusive upper [OK]
Quick Trick: gte includes boundary, lt excludes boundary [OK]
Common Mistakes:
MISTAKES
  • Assuming lt includes the upper bound
  • Confusing gte with gt
  • Including age 40 incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes