BM25
Also: Okapi BM25
The standard sparse, lexical retrieval score, a refinement of TF-IDF: each query term contributes its IDF times a term-frequency factor that saturates (k₁) and is normalized by document length (b). It excels at exact names and codes but knows nothing of synonyms.
BM25(q, d) = Σₜ IDF(t) · f(t,d)·(k₁+1) / ( f(t,d) + k₁·(1 − b + b·|d|/avgdl) )
Example
With k₁ = 1.2 in an average-length document, a term appearing 1, 2 or 10 times gets a TF factor of 1.0, 1.375 or 1.96: repetition helps, with sharply diminishing returns. A query for "E-4042" finds the exact error-code document that embeddings blur.