Sort and pagination
/ Sort, / Pagination, / SearchSort and pagination #
Control which documents come back and in what order — sort, from/size,
search_after/search_before, and total-hit accounting.
POST /my-collection/_search
How it works #
sort is an array of sort clauses evaluated in order; the first clause
that produces a difference decides the order. Sorting on an indexed field
lets the collector skip documents that cannot make the cut (early
termination), so field sorts — and _doc above all — are cheaper than
score sorts, not just differently ordered.