Best Matching 25 (BM25) is a ranking algorithm that uses lexical matching to find precise word or phrase matches. It’s very effective when searching for queries matches containing unique identifiers or technical terms.

BM25 is built based on TF-IDF concept and also taking into account the document length and applying a saturation function to term frequency, which helps prevent common words from dominating the results.