Revision: 14696
          http://gate.svn.sourceforge.net/gate/?rev=14696&view=rev
Author:   valyt
Date:     2011-12-08 10:24:31 +0000 (Thu, 08 Dec 2011)
Log Message:
-----------
Bugfix: also advance when getting the first document, if we have been given a 
lower bound.

Modified Paths:
--------------
    mimir/trunk/mimir-core/src/gate/mimir/search/query/OrQuery.java

Modified: mimir/trunk/mimir-core/src/gate/mimir/search/query/OrQuery.java
===================================================================
--- mimir/trunk/mimir-core/src/gate/mimir/search/query/OrQuery.java     
2011-12-08 02:18:19 UTC (rev 14695)
+++ mimir/trunk/mimir-core/src/gate/mimir/search/query/OrQuery.java     
2011-12-08 10:24:31 UTC (rev 14696)
@@ -110,20 +110,18 @@
     public int nextDocument(int greaterThan) throws IOException {
       if(closed) return latestDocument = -1;
       if(latestDocument == -1) return latestDocument;
-      if(latestDocument != -2) {
-        // advance
-        int first = queue.first();
-        while(currentDoc[first] == latestDocument || 
-              currentDoc[first] <= greaterThan) {
-          currentDoc[first] = executors.nextDocument(first, greaterThan);
-          if(currentDoc[first] < 0) {
-            queue.dequeue();
-            if(queue.isEmpty()) return latestDocument = -1;
-          } else {
-            queue.changed();            
-          }
-          first = queue.first();
+      // advance
+      int first = queue.first();
+      while(currentDoc[first] == latestDocument || 
+            currentDoc[first] <= greaterThan) {
+        currentDoc[first] = executors.nextDocument(first, greaterThan);
+        if(currentDoc[first] < 0) {
+          queue.dequeue();
+          if(queue.isEmpty()) return latestDocument = -1;
+        } else {
+          queue.changed();            
         }
+        first = queue.first();
       }
       latestDocument = currentDoc[queue.first()];
       // collect all the hits from the current document

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to