Skip to content

Commit f8215e7

Browse files
Add doc on rank_feature(s) negative score impact (#71795)
Add a warning about consequences of negative score impact for documents that don't have values for rank_feature(s) fields. Related to #69994
1 parent 03dee5b commit f8215e7

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

docs/reference/mapping/types/rank-features.asciidoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,3 @@ Rank features that correlate negatively with the score should set
9393
the <<query-dsl-rank-feature-query,`rank_feature`>> query to modify the scoring formula
9494
in such a way that the score decreases with the value of the feature instead of
9595
increasing.
96-

docs/reference/query-dsl/rank-feature-query.asciidoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ The `rank_feature` query is typically used in the `should` clause of a
1212
<<query-dsl-bool-query,`bool`>> query so its relevance scores are added to other
1313
scores from the `bool` query.
1414

15+
With `positive_score_impact` set to `false` for a `rank_feature` or
16+
`rank_features` field, we recommend that every document that participates
17+
in a query has a value for this field. Otherwise, if a `rank_feature` query
18+
is used in the should clause, it doesn't add anything to a score of
19+
a document with a missing value, but adds some boost for a document
20+
containing a feature. This is contrary to what we want – as we consider these
21+
features negative, we want to rank documents containing them lower than documents
22+
missing them.
23+
1524
Unlike the <<query-dsl-function-score-query,`function_score`>> query or other
1625
ways to change <<relevance-scores,relevance scores>>, the
1726
`rank_feature` query efficiently skips non-competitive hits when the

0 commit comments

Comments
 (0)