Repository: incubator-blur Updated Branches: refs/heads/apache-blur-0.2 9cc7e80f5 -> 9de8a93ae
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/apache-blur-0.2 Commit: 9de8a93aef77aa6bd8f91e8bfafc647a3a806ed0 Parents: 9cc7e80 Author: Aaron McCurry <[email protected]> Authored: Tue Mar 25 19:36:25 2014 -0400 Committer: Aaron McCurry <[email protected]> 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();
