If you query a text index and the ranking looks sensible, there is a good chance it is BM25 underneath. The formula looks scary but it encodes three simple ideas.
score(D, Q) = sum over terms q in Q of
IDF(q) * f(q, D) * (k1 + 1)
---------------------------------------------
f(q, D) + k1 * (1 - b + b * |D| / avgdl)
- IDF: rare terms matter more. A match on "ocsp" tells you more than a match on "the".
- Saturation: the term frequency
fgrows the score, but with diminishing returns. Asfgoes to infinity, the fraction goes tok1 + 1. Mentioning a word 50 times is not 50 times as relevant as mentioning it once. - Length normalisation: a long document naturally contains more terms, so
b(usually 0.75) shrinks the score of documents longer than average.
Typical defaults are k1 between 1.2 and 2.0 and b = 0.75. Both are worth tuning on your own queries, with some relevance judgements to measure against, not by feel.
It is a baseline that is cheap, explainable, and hard to beat by much without labelled data. Treat it like a database index: boring and enormously useful.