From 975dbecfa9ab964a9a0f0bfc76017cd0daba1333 Mon Sep 17 00:00:00 2001 From: Mayya Sharipova Date: Wed, 23 Oct 2019 16:45:10 -0400 Subject: [PATCH] Correct rewritting of script_score query (#48425) Previously there was a bug when an query inside script_score query was rewritten. If min_score was not set and was equal to null, we were converting it to float value which resulted to NPE. This commit corrects this. Closes #48081 --- .../ScriptScoreQueryBuilder.java | 4 +++- .../search/query/ScriptScoreQueryIT.java | 24 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/org/elasticsearch/index/query/functionscore/ScriptScoreQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/functionscore/ScriptScoreQueryBuilder.java index 4872e92e2d7..59086f163a1 100644 --- a/server/src/main/java/org/elasticsearch/index/query/functionscore/ScriptScoreQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/functionscore/ScriptScoreQueryBuilder.java @@ -183,7 +183,9 @@ public class ScriptScoreQueryBuilder extends AbstractQueryBuilder