Skip to content

    BM25 Ranking

    Data integration & searchBM25Okapi BM25Best Matching 25
    Reading time: 3 min.Editorially reviewed on:

    Definition

    Classic ranking function in Information Retrieval, which evaluates documents based on search terms, term frequency, document length and rarity of terms.

    BM25 calculates one relevance score per document for a search query. Frequent search terms in the document increase the score with decreasing added value; rare terms are weighted more strongly and the document length is normalized. BM25 works lexically and does not understand semantic similarity like an embedding model.

    Simply explained

    A document gets points if the searched words appear in it – especially if the words are rare and characteristic of the document.

    Why it matters in practice

    Very relevant for full text search, hybrid search and RAG. BM25 is a strong baseline and complements vector search well if exact terms, numbers or technical words are important.

    Example from business

    Example scenario: An internal search combines BM25 for exact product codes with semantic vector search for similar formulations.

    Limits and pitfalls

    • Calling BM25 semantic search; adopting parameters unchecked; ignoring tokenization and language processing; combining incompatible scores without a suitable fusion strategy in hybrid search.

    Origin & history

    BM25 belongs to probabilistic information retrieval. Robertson and Zaragoza described BM25 and extensions in 2009 as part of an overview of the probabilistic relevance model.

    Use in mid-sized companies

    • Use for document, knowledge and product search, especially when exact terms are relevant; combine them with embeddings and reranking if necessary.

    Frequently asked questions

    Is BM25 semantic search?

    No, primarily lexical.

    Is BM25 obsolete?

    No, it remains a strong search baseline.

    Can BM25 be combined with vector search?

    Yes.

    Sources

    Source check: 09.10.2026. Definition and documented classification verified; examples describe possible applications.

    Editorially reviewed on:

    On this page

    Next step

    Put knowledge into practice