BM25 powers billions of searches daily. But 90% of developers can't...

Femke Plantinga@femke_plantinga
11 views
Oct 29, 2025
~1 min read
1
BM25 powers billions of searches daily.
But 90% of developers can't explain how it actually ranks results.
๐๐ ๐ฎ๐ฑ๐ is the algorithm that powers keyword search in most modern search engines.
Here's a super simple breakdown of how BM25 works:
โข ๐ง๐ฒ๐ฟ๐บ ๐๐ฟ๐ฒ๐พ๐๐ฒ๐ป๐ฐ๐ (๐ง๐) counts how often your search terms appear in a document.
โข ๐๐ป๐๐ฒ๐ฟ๐๐ฒ ๐๐ผ๐ฐ๐๐บ๐ฒ๐ป๐ ๐๐ฟ๐ฒ๐พ๐๐ฒ๐ป๐ฐ๐ (๐๐๐) measures how rare your search term is across all documents. The word โsportsโ might appear a lot in a collection of sports articles, but โAIโ would be rarer, and weighted more heavily.
โข ๐๐ผ๐ฐ๐๐บ๐ฒ๐ป๐ ๐๐ฒ๐ป๐ด๐๐ต ๐ก๐ผ๐ฟ๐บ๐ฎ๐น๐ถ๐๐ฎ๐๐ถ๐ผ๐ป: Short documents get weighted higher because each word has more โweightโ in how important it is.
But wait, there's moreโฆ
โจ๐๐ ๐ฎ๐ฑ๐โจ extends this to handle multiple fields: title, abstract, and body text with different importance weights. Your title matches might matter more than body text matches.
๐ง๐ต๐ฒ ๐ฟ๐ฒ๐ฎ๐น๐ถ๐๐ ๐ฐ๐ต๐ฒ๐ฐ๐ธ:
BM25 is fast and doesn't need fancy embeddings or models. But it's still just matching exact tokens - it won't understand that "car" and "automobile" mean the same thing.
That's why modern search often combines BM25 with vector search, which uses AI embedding models to capture the meaning of words or phrases, in hybrid approaches. Best of both worlds.
Learn more: docs.weaviate.io/weaviate/searcโฆ
But 90% of developers can't explain how it actually ranks results.
๐๐ ๐ฎ๐ฑ๐ is the algorithm that powers keyword search in most modern search engines.
Here's a super simple breakdown of how BM25 works:
โข ๐ง๐ฒ๐ฟ๐บ ๐๐ฟ๐ฒ๐พ๐๐ฒ๐ป๐ฐ๐ (๐ง๐) counts how often your search terms appear in a document.
โข ๐๐ป๐๐ฒ๐ฟ๐๐ฒ ๐๐ผ๐ฐ๐๐บ๐ฒ๐ป๐ ๐๐ฟ๐ฒ๐พ๐๐ฒ๐ป๐ฐ๐ (๐๐๐) measures how rare your search term is across all documents. The word โsportsโ might appear a lot in a collection of sports articles, but โAIโ would be rarer, and weighted more heavily.
โข ๐๐ผ๐ฐ๐๐บ๐ฒ๐ป๐ ๐๐ฒ๐ป๐ด๐๐ต ๐ก๐ผ๐ฟ๐บ๐ฎ๐น๐ถ๐๐ฎ๐๐ถ๐ผ๐ป: Short documents get weighted higher because each word has more โweightโ in how important it is.
But wait, there's moreโฆ
โจ๐๐ ๐ฎ๐ฑ๐โจ extends this to handle multiple fields: title, abstract, and body text with different importance weights. Your title matches might matter more than body text matches.
๐ง๐ต๐ฒ ๐ฟ๐ฒ๐ฎ๐น๐ถ๐๐ ๐ฐ๐ต๐ฒ๐ฐ๐ธ:
BM25 is fast and doesn't need fancy embeddings or models. But it's still just matching exact tokens - it won't understand that "car" and "automobile" mean the same thing.
That's why modern search often combines BM25 with vector search, which uses AI embedding models to capture the meaning of words or phrases, in hybrid approaches. Best of both worlds.
Learn more: docs.weaviate.io/weaviate/searcโฆ
