incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cr...@apache.org
Subject [06/50] [abbrv] git commit: Fixing an edge case bug that caused array out of bounds exceptions when the scorer finished during a leap.
Date Sun, 18 May 2014 21:41:41 GMT
Fixing an edge case bug that caused array out of bounds exceptions when the scorer finished
during a leap.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/9de8a93a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/9de8a93a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/9de8a93a

Branch: refs/heads/console-v2
Commit: 9de8a93aef77aa6bd8f91e8bfafc647a3a806ed0
Parents: 9cc7e80
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Tue Mar 25 19:36:25 2014 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Tue Mar 25 19:36:25 2014 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/blur/lucene/search/FacetExecutor.java  | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/9de8a93a/blur-query/src/main/java/org/apache/blur/lucene/search/FacetExecutor.java
----------------------------------------------------------------------
diff --git a/blur-query/src/main/java/org/apache/blur/lucene/search/FacetExecutor.java b/blur-query/src/main/java/org/apache/blur/lucene/search/FacetExecutor.java
index 41c6400..615135e 100644
--- a/blur-query/src/main/java/org/apache/blur/lucene/search/FacetExecutor.java
+++ b/blur-query/src/main/java/org/apache/blur/lucene/search/FacetExecutor.java
@@ -40,6 +40,7 @@ import org.apache.blur.trace.Tracer;
 import org.apache.lucene.index.AtomicReader;
 import org.apache.lucene.index.AtomicReaderContext;
 import org.apache.lucene.search.Collector;
+import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.Scorer;
 import org.apache.lucene.util.OpenBitSet;
 
@@ -80,6 +81,9 @@ public class FacetExecutor {
           throw new Finished();
         } else {
           int advance = _scorer.advance(nextSetBit);
+          if (advance == DocIdSetIterator.NO_MORE_DOCS) {
+            throw new Finished();
+          }
           if (_bitSet.fastGet(advance)) {
             _hits++;
           }
@@ -324,6 +328,7 @@ public class FacetExecutor {
               try {
                 entry.getValue().process(_counts, _minimumsBeforeReturning, _running);
               } catch (IOException e) {
+                LOG.error("Unknown error", e);
                 throw new RuntimeException(e);
               } finally {
                 finished.incrementAndGet();


Mime
View raw message