ts_rank
A ranking function in PostgreSQL's built-in full-text search that computes a relevance score based on local information such as term frequency, but lacks corpus-wide document frequency statistics.
Timeline (last 90 days)
BM25 requires global statistics (document frequency, average document length), so it usually needs support from a dedicated index structure, whereas PostgreSQL's built-in ts_rank lacks whole-database document frequency statistics.
LectuLibre's FastAPI search endpoint completes websearch_to_tsquery parsing, @@ filtering, ts_headline highlighted snippet generation, and ts_rank relevance sorting in a single SQL query, avoiding the overhead of pulling the full text back to the application layer for processing.
All Facts (2)
BM25 requires global statistics (document frequency, average document length), so it usually needs support from a dedicated index structure, whereas PostgreSQL's built-in ts_rank lacks whole-database document frequency statistics.
50%UnverifiedLectuLibre's FastAPI search endpoint completes websearch_to_tsquery parsing, @@ filtering, ts_headline highlighted snippet generation, and ts_rank relevance sorting in a single SQL query, avoiding the overhead of pulling the full text back to the application layer for processing.
50%