What it does

BM25 helps rank search results by checking how well a document matches the search words.

Relevance: How well a result matches • Saturation: Stopping counting

How it works

  • Count matching words.
  • Adjust for very long or very short documents.
  • Rank the best matches higher.

Uses & Applications

  • A website search box can show the best pages first.
  • A help center can find the right support article.
  • An online store can rank products that match your search.
In short

BM25 is used for search ranking.

Try it yourself

Put useful search results first

Search four short notes. Score notes by matching words, while allowing for different note lengths.

Your turn

Change one setting at a time. Reset example puts everything back.

Rank a small document collection

Step 1
Why this happens

Look closer at the numbers
Numbers used in this example