The full name of the BM25 algorithm is Okapi BM25, which is an extension of the binary independent model and can be used to sort the relevance of the search.
The default correlation algorithm for Sphinx is the BM25. You can also choose to use the BM25 algorithm after Lucene4.0 (the default is TF-IDF). If you are using SOLR, just modify the Schema.xml and add the following line to
- <similarity Class="SOLR." Bm25similarity "/>
BM25 is also based on the word frequency of the calculation of the formula, participle of the results of its calculation is also very important
IDF formula
- F (qi,d): is the word frequency
- | d|:[the length of the given document]D.
- AVGDL: The length of all documents in the index.
Abstract point of view, BM25 formula in fact and TF-IDF formula is similar, can also be used as =∑IDF (q) * FX (TF),
However, BM25 's IDF and TF have made some variants, especially the TF formula, and added two empirical parameters K1 and b,k1 and B to adjust the accuracy, generally we take k1=2,b=0.75
As to which correlation algorithm is better for BM25 and TF-IDF, I think it depends on the search quality evaluation criteria
SOLR Similarity Algorithm II: bm25similarity