jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1459810 - /jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NotQuery.java
Date Fri, 22 Mar 2013 14:36:05 GMT
Author: ard
Date: Fri Mar 22 14:36:04 2013
New Revision: 1459810

URL: http://svn.apache.org/r1459810
Log:
JCR-3539 backport : fix the NotQuery to have a advance and nextDoc working in line with how
Lucene contract is.  In case of a Filter was applied in the search, that now works as well

Modified:
    jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NotQuery.java

Modified: jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NotQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NotQuery.java?rev=1459810&r1=1459809&r2=1459810&view=diff
==============================================================================
--- jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NotQuery.java
(original)
+++ jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NotQuery.java
Fri Mar 22 14:36:04 2013
@@ -177,6 +177,8 @@ class NotQuery extends Query {
          */
         private int contextNo = -1;
 
+        private boolean firstTime = true;
+
         /**
          * Creates a new scorer
          * @param reader
@@ -192,7 +194,8 @@ class NotQuery extends Query {
                 return docNo;
             }
 
-            if (docNo == -1) {
+            if (firstTime) {
+                firstTime = false;
                 // get first doc of context scorer
                 int docId = contextScorer.nextDoc();
                 if (docId != NO_MORE_DOCS) {



Mime
View raw message