BM25

The standard keyword ranking function, which scores a document on the query words it contains, weighted by rarity, saturated for repeats and normalised for length.

In more detail

Its two settings are k1, how quickly repeats stop adding score (1.2 by default in Elasticsearch), and b, how strongly long documents are penalised (0.75). It remains a strong baseline that semantic search often fails to beat on names and codes.

Example

score = Σ IDF(t) · tf·(k1+1) / (tf + k1·(1 − b + b·len/avglen))

Related terms

Taught in

References

Certification courses