Custom Ordering

@@@ does not perform any sorting on the result set. In particular, it does not compute or sort by BM25 score. score_bm25 should be used for that.

To order the result set by a field, ORDER BY should be used.

SELECT description, rating FROM mock_items
WHERE id @@@ 'description:shoes'
ORDER BY rating;

The order can either be ASC or DESC. The default order is ASC.

SELECT description, rating FROM mock_items
WHERE id @@@ 'description:shoes'
ORDER BY rating DESC;