Bird
0
0

What will be the effect of this Elasticsearch sort clause?

medium📝 Predict Output Q5 of 15
Elasticsearch - Search Results and Scoring
What will be the effect of this Elasticsearch sort clause?
"sort": [{"price": {"order": "asc", "missing": "_last"}}]
ASort by price descending, placing documents missing price at the end
BSort by price ascending, placing documents missing price at the beginning
CSort by price ascending, placing documents missing price at the end
DSort by price descending, placing documents missing price at the beginning
Step-by-Step Solution
Solution:
  1. Step 1: Understand the order and missing parameters

    Order "asc" means sorting prices from low to high. "missing": "_last" means documents without price appear last.
  2. Step 2: Confirm effect on missing values

    Documents missing the price field are placed after all documents with a price.
  3. Final Answer:

    Sort by price ascending, placing documents missing price at the end -> Option C
  4. Quick Check:

    Missing _last puts missing values at end [OK]
Quick Trick: Use "missing": "_last" to put missing values at end [OK]
Common Mistakes:
MISTAKES
  • Confusing _last with _first
  • Mixing ascending with descending order
  • Ignoring missing parameter effect

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes