-
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.>bugTeam:Search RelevanceMeta label for the Search Relevance team in ElasticsearchMeta label for the Search Relevance team in Elasticsearch
Description
Current boost parameter in script_score query is wrongly only applied to the subquery.
For example, this query returns 1 without applying boost:
"query": {
"script_score" : {
"query" : {
"match_all": {}
},
"script" : {
"source" : "1"
},
"boost": 3
}
}While this query returns 3 applying boost to the subquery.
"query": {
"script_score" : {
"query" : {
"match_all": {}
},
"script" : {
"source" : "_score"
},
"boost": 3
}
}This behaviour was partially copied from function_score query where boost is applied to both subquery and the whole query. For example, this query returns 9 where boost is applied to the subquery and also the whole query (which is quite confusing).
"query": {
"function_score" : {
"query" : {
"match_all": {}
},
"script_score" : {
"script" : {
"source" : "_score"
}
},
"boost": 3
}
}We need to correct boost behaviour in script_score to apply only the whole query, and not subquery.
Metadata
Metadata
Assignees
Labels
:Search Relevance/RankingScoring, rescoring, rank evaluation.Scoring, rescoring, rank evaluation.>bugTeam:Search RelevanceMeta label for the Search Relevance team in ElasticsearchMeta label for the Search Relevance team in Elasticsearch