Sort by relevance score.
Section: Search, rank, and highlight
Rank results with bm25()
sql
sql
SELECT rowid, title, bm25(docs) AS rank
FROM docs
WHERE docs MATCH 'sqlite wal'
ORDER BY rank;Explanation
bm25() is the usual relevance-ranking helper for FTS5 results.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Search, rank, and highlight