What is bm25

Last updated: April 1, 2026

Quick Answer: BM25 is a ranking function used in search engines and information retrieval systems to determine the relevance of documents to search queries.

Key Facts

What is BM25?

BM25 is a ranking function used in information retrieval and search engines to assess the relevance of documents to user search queries. The acronym stands for 'Best Match 25,' referring to the 25th iteration of algorithms developed within the Probabilistic Relevance Framework. BM25 has become one of the most widely adopted ranking algorithms in the search industry due to its effectiveness in producing relevant search results.

How BM25 Works

BM25 calculates relevance scores by analyzing multiple factors:

Historical Development

BM25 evolved from probabilistic information retrieval research conducted in the 1990s. Researchers at City University London developed successive iterations of the algorithm, with BM25 representing a mature, effective version that balanced accuracy with computational efficiency. Its success led to widespread adoption across the search and information retrieval industry.

Applications and Adoption

BM25 is the default ranking function in major search and retrieval technologies including Elasticsearch, Apache Lucene, Solr, and many other enterprise search platforms. Web search engines, internal company search systems, and research databases frequently employ BM25 or variations of the algorithm to rank documents and return relevant results to users.

Advantages Over Simpler Methods

Unlike basic keyword matching that treats all terms equally, BM25 provides more nuanced relevance scoring. It prevents manipulation through term repetition, accounts for document structure, and adapts to query complexity. This makes BM25 superior for returning highly relevant results even with complex, multi-word queries.

Related Questions

Why is BM25 better than simple keyword matching?

BM25 considers term frequency, inverse document frequency, and document length normalization, providing more nuanced relevance scores that better match user intent compared to simple keyword counting.

What search engines use BM25?

BM25 is used in Elasticsearch, Apache Lucene, Solr, and many enterprise search platforms. Many major search engines and information retrieval systems employ BM25 or similar probabilistic algorithms.

Can BM25 be customized?

Yes, BM25 includes tunable parameters (k1 and b parameters) that allow customization for different types of documents and search scenarios to optimize relevance results.

Sources

  1. Wikipedia - Okapi BM25 CC-BY-SA-4.0
  2. Elasticsearch BM25 Documentation Copyright Elastic