Ranking score

    When using the showRankingScore search parameter, Meilisearch adds a global ranking score field, _rankingScore, to each document. The _rankingScore is between 0.0 and 1.0. The higher the ranking score, the more relevant the document.

    Ranking rules sort documents either by relevancy (words, typo, proximity, exactness, attribute) or by the value of a field (sort). Since sort doesn't rank documents by relevancy, it does not influence the _rankingScore.

    NOTE

    A document's ranking score does not change based on the scores of other documents in the same index.

    For example, if a document A has a score of 0.5 for a query term, this value remains constant no matter the score of documents B, C, or D.

    The table below details all the index settings that can influence the _rankingScore. Unlisted settings do not influence the ranking score.

    Index settingInfluences ifRationale
    searchableAttributesThe attribute ranking rule is usedThe attribute ranking rule rates the document depending on the attribute in which the query terms show up. The order is determined by searchableAttributes
    rankingRulesAlwaysThe score is computed by computing the subscore of each ranking rule with a weight that depends on their order
    stopWordsAlwaysStop words influence the words ranking rule, which is almost always used
    synonymsAlwaysSynonyms influence the words ranking rule, which is almost always used
    typoToleranceThe typo ranking rule is usedUsed to compute the maximum number of typos for a query