Tachyontachyon

Sorting

Order search results by field values or by relevance.

The sort search parameter takes a comma-separated list of field:direction clauses, evaluated left to right — later clauses break ties from earlier ones:

sort=_text_match:desc,price:asc
  • Each clause needs an explicit direction (asc or desc) — there's no default direction to omit.
  • Only fields declared sort: true can be used.
  • _text_match is a special pseudo-field for BM25 relevance — not a real field on your documents, but always available as a sort key.
  • If two documents tie on every clause (or sort is omitted and no default_sorting_field applies), ties break on document id.

Examples

Cheapest first:

curl 'localhost:8108/collections/products/search?q=keyboard&sort=price:asc'

Most relevant first, then cheapest as a tiebreaker:

curl 'localhost:8108/collections/products/search?q=keyboard&sort=_text_match:desc,price:asc'

On this page