From 4678482b3ce2a6e24cc48ab2d31ac157c8f9f2ed Mon Sep 17 00:00:00 2001 From: Steve Perkins Date: Wed, 27 Jul 2022 15:14:59 -0400 Subject: [PATCH] Factor _score in to script_score script (#3556) --- discovery-provider/src/queries/search_es.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discovery-provider/src/queries/search_es.py b/discovery-provider/src/queries/search_es.py index e9b70808d24..15003725ffc 100644 --- a/discovery-provider/src/queries/search_es.py +++ b/discovery-provider/src/queries/search_es.py @@ -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)" }, } },