Skip to content

Commit

Permalink
Factor _score in to script_score script (#3556)
Browse files Browse the repository at this point in the history
  • Loading branch information
stereosteve committed Jul 27, 2022
1 parent 5b31feb commit 4678482
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion discovery-provider/src/queries/search_es.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def default_function_score(dsl, ranking_field):
"script_score": {
"query": {"bool": dsl},
"script": {
"source": f" Math.log(Math.max(doc['{ranking_field}'].value, 0) + 2)"
"source": f"_score * Math.log(Math.max(doc['{ranking_field}'].value, 0) + 2)"
},
}
},
Expand Down

0 comments on commit 4678482

Please sign in to comment.