Merge pull request #11398 from Collaborne/bugs/explain-function-script-quotes

Fix the quotes in the explain message for a script score function without parameters
This commit is contained in:
Nik Everett 2015-10-15 13:56:21 -04:00
commit 68d708a75f

View File

@ -111,9 +111,9 @@ public class ScriptScoreFunction extends ScoreFunction {
exp = ((ExplainableSearchScript) leafScript).explain(subQueryScore); exp = ((ExplainableSearchScript) leafScript).explain(subQueryScore);
} else { } else {
double score = score(docId, subQueryScore.getValue()); double score = score(docId, subQueryScore.getValue());
String explanation = "script score function, computed with script:\"" + sScript; String explanation = "script score function, computed with script:\"" + sScript + "\"";
if (sScript.getParams() != null) { if (sScript.getParams() != null) {
explanation += "\" and parameters: \n" + sScript.getParams().toString(); explanation += " and parameters: \n" + sScript.getParams().toString();
} }
Explanation scoreExp = Explanation.match( Explanation scoreExp = Explanation.match(
subQueryScore.getValue(), "_score: ", subQueryScore.getValue(), "_score: ",