jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1459814 - /jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NotQuery.java
Date Fri, 22 Mar 2013 14:42:10 GMT
Author: ard
Date: Fri Mar 22 14:42:10 2013
New Revision: 1459814

URL: http://svn.apache.org/r1459814
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.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NotQuery.java

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NotQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NotQuery.java?rev=1459814&r1=1459813&r2=1459814&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NotQuery.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NotQuery.java
Fri Mar 22 14:42:10 2013
@@ -168,6 +168,8 @@ class NotQuery extends Query {
          */
         private int contextNo = -1;
 
+        private boolean firstTime = true;
+
         /**
          * Creates a new scorer
          * @param reader
@@ -181,7 +183,8 @@ class NotQuery extends Query {
          * {@inheritDoc}
          */
         public boolean next() throws IOException {
-            if (docNo == -1) {
+            if (firstTime) {
+                firstTime = false;
                 // get first doc of context scorer
                 if (contextScorer.next()) {
                     contextNo = contextScorer.doc();



Mime
View raw message