lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r994976 - /lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/BooleanQuery.java
Date Wed, 08 Sep 2010 10:33:38 GMT
Author: mikemccand
Date: Wed Sep  8 10:33:38 2010
New Revision: 994976

URL: http://svn.apache.org/viewvc?rev=994976&view=rev
Log:
LUCENE-2635: fix BQ to not provide matching explanation if a required sub-clause has null
scorer

Modified:
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/BooleanQuery.java

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/BooleanQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/BooleanQuery.java?rev=994976&r1=994975&r2=994976&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/BooleanQuery.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/BooleanQuery.java Wed Sep  8
10:33:38 2010
@@ -240,6 +240,11 @@ public class BooleanQuery extends Query 
         Weight w = wIter.next();
         BooleanClause c = cIter.next();
         if (w.scorer(reader, true, true) == null) {
+          if (c.isRequired()) {
+            fail = true;
+            Explanation r = new Explanation(0.0f, "no match on required clause (" + c.getQuery().toString()
+ ")");
+            sumExpl.addDetail(r);
+          }
           continue;
         }
         Explanation e = w.explain(reader, doc);



Mime
View raw message