diff --git a/CHANGES.txt b/CHANGES.txt index 4190e233bd4..27d473b1478 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -70,6 +70,9 @@ Changes in runtime behavior with that name does not exist. (hossman, SOLR-43) 6. The DisMaxRequestHandler now supports multiple occurances of the "fq" param. (hossman, SOLR-44) + 7. FunctionQuery.explain now uses ComplexExplanation to provide more + accurate score explanations when composed in a BooleanQuery. + (hossman, SOLR-25) Optimizations 1. getDocListAndSet can now generate both a DocList and a DocSet from a diff --git a/src/java/org/apache/solr/search/function/FunctionQuery.java b/src/java/org/apache/solr/search/function/FunctionQuery.java index d045aad8a51..41f45565cc7 100644 --- a/src/java/org/apache/solr/search/function/FunctionQuery.java +++ b/src/java/org/apache/solr/search/function/FunctionQuery.java @@ -134,10 +134,9 @@ public class FunctionQuery extends Query { public Explanation explain(int doc) throws IOException { float sc = qWeight * vals.floatVal(doc); - Explanation result = new Explanation(); - result.setDescription("FunctionQuery(" + func - + "), product of:"); - result.setValue(sc); + Explanation result = new ComplexExplanation + (true, sc, "FunctionQuery(" + func + "), product of:"); + result.addDetail(vals.explain(doc)); result.addDetail(new Explanation(getBoost(), "boost")); result.addDetail(new Explanation(weight.queryNorm,"queryNorm"));