You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by ho...@apache.org on 2006/10/04 20:53:07 UTC

svn commit: r452973 - in /incubator/solr/trunk: CHANGES.txt src/java/org/apache/solr/search/function/FunctionQuery.java

Author: hossman
Date: Wed Oct  4 11:53:06 2006
New Revision: 452973

URL: http://svn.apache.org/viewvc?view=rev&rev=452973
Log:
SOLR-25 - change FunctionQuery to use ComplexExplanation

Modified:
    incubator/solr/trunk/CHANGES.txt
    incubator/solr/trunk/src/java/org/apache/solr/search/function/FunctionQuery.java

Modified: incubator/solr/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/CHANGES.txt?view=diff&rev=452973&r1=452972&r2=452973
==============================================================================
--- incubator/solr/trunk/CHANGES.txt (original)
+++ incubator/solr/trunk/CHANGES.txt Wed Oct  4 11:53:06 2006
@@ -70,6 +70,9 @@
     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 

Modified: incubator/solr/trunk/src/java/org/apache/solr/search/function/FunctionQuery.java
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/src/java/org/apache/solr/search/function/FunctionQuery.java?view=diff&rev=452973&r1=452972&r2=452973
==============================================================================
--- incubator/solr/trunk/src/java/org/apache/solr/search/function/FunctionQuery.java (original)
+++ incubator/solr/trunk/src/java/org/apache/solr/search/function/FunctionQuery.java Wed Oct  4 11:53:06 2006
@@ -134,10 +134,9 @@
     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"));