Interface BM25Params

Parameters of the BM25+ scoring algorithm. Customizing these is almost never necessary, and fine-tuning them requires an understanding of the BM25 scoring model.

Some information about BM25 (and BM25+) can be found at these links:

interface BM25Params {
    b: number;
    d: number;
    k: number;


b d k


b: number

Length normalization impact.

Recommended values are around 0.75. Higher values increase the weight that field length has on scoring. Setting this to 0 (not recommended) means that the field length has no effect on scoring. Negative values are invalid. Defaults to 0.7.

d: number

BM25+ frequency normalization lower bound (usually called δ).

Recommended values are between 0.5 and 1. Increasing this parameter increases the minimum relevance of one occurrence of a search term regardless of its (possibly very long) field length. Negative values are invalid. Defaults to 0.5.

k: number

Term frequency saturation point.

Recommended values are between 1.2 and 2. Higher values increase the difference in score between documents with higher and lower term frequencies. Setting this to 0 or a negative value is invalid. Defaults to 1.2

Generated using TypeDoc