Class BM25SimilarityFactory

  • public class BM25SimilarityFactory
    extends SimilarityFactory
    Factory for BM25Similarity. This is the default similarity since 8.x. If you need the exact same formula as in 6.x and 7.x you should instead look at LegacyBM25SimilarityFactory


    • k1 (float): Controls non-linear term frequency normalization (saturation). The default is 1.2
    • b (float): Controls to what degree document length normalizes tf values. The default is 0.75

    Optional settings:

    • discountOverlaps (bool): Sets BM25Similarity.setDiscountOverlaps(boolean)
    WARNING: This API is experimental and might change in incompatible ways in the next release.