Bird
Raised Fist0

You wrote this query but get an error:

medium📝 Debug Q6 of Q15
Elasticsearch - Advanced Patterns
You wrote this query but get an error:
{"sort": [{"price": "asc"}], "size": 3, "search_after": [100]}

What is the likely cause?
AThe size parameter is too large
BThe search_after value type does not match the sort field type
CThe sort order must be descending for search_after
DThe search_after array must be empty
Step-by-Step Solution
Solution:
  1. Step 1: Check the data types of sort and search_after

    If the price field is a float but search_after uses an integer or incompatible type, it causes an error.

  2. Step 2: Confirm other options are invalid

    Size 3 is valid, sort order can be ascending, and search_after cannot be empty.

  3. Final Answer:

    The search_after value type does not match the sort field type -> Option B
  4. Quick Check:

    search_after type must match sort field type [OK]
Quick Trick: Match search_after values' types exactly to sort fields [OK]
Common Mistakes:
MISTAKES
  • Using wrong data type in search_after
  • Assuming size affects search_after behavior

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes