-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
:Search Relevance/RankingScoring, rescoring, rank evaluation.Scoring, rescoring, rank evaluation.>breakingTeam:Search RelevanceMeta label for the Search Relevance team in ElasticsearchMeta label for the Search Relevance team in Elasticsearchblockerv7.0.0-beta1
Description
Negative scores are not allowed in Lucene 8 so we should make sure that we don't produce any deliberately. The following is an (hopefully) exhaustive list of places where negative values should be forbidden in es 7 and deprecated in 6x:
- Query boosts should always be positive (Disallow negative query boost #34486)
- Field boosts should always be positive.
-
script_scorefunction should return positive scores. (Forbid negative scores in function_score query #35709) - Scripted similarity should return positive scores. (Add minimal sanity checks to custom/scripted similarities. #33564)
- Custom similarity should return positive scores. (Add minimal sanity checks to custom/scripted similarities. #33564)
Query and field boosts are trivial, negative values can be detected during the parsing of the query. For similarities and scripts we cannot infer easily if the values can be negative or not so we'll have to check scores during query execution and fail the request if a negative score is produced.
Metadata
Metadata
Assignees
Labels
:Search Relevance/RankingScoring, rescoring, rank evaluation.Scoring, rescoring, rank evaluation.>breakingTeam:Search RelevanceMeta label for the Search Relevance team in ElasticsearchMeta label for the Search Relevance team in Elasticsearchblockerv7.0.0-beta1