incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [1/2] git commit: Adding an check for when the docid is less than 0. This should never occur, however it does so we are dealing with it and logging an error.
Date Tue, 18 Mar 2014 23:53:27 GMT
Repository: incubator-blur
Updated Branches:
  refs/heads/apache-blur-0.2 7a7df8fa7 -> 86632167c


Adding an check for when the docid is less than 0.  This should never occur, however it does
so we are dealing with it and logging an error.


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

Branch: refs/heads/apache-blur-0.2
Commit: df6d7f29367a00c0a3d7934f8547abd757d2660a
Parents: 7a7df8f
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Tue Mar 18 19:49:29 2014 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Tue Mar 18 19:49:29 2014 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/blur/lucene/search/FacetQuery.java  | 8 ++++++++
 .../main/java/org/apache/blur/lucene/search/SuperQuery.java  | 7 +++++++
 2 files changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/df6d7f29/blur-query/src/main/java/org/apache/blur/lucene/search/FacetQuery.java
----------------------------------------------------------------------
diff --git a/blur-query/src/main/java/org/apache/blur/lucene/search/FacetQuery.java b/blur-query/src/main/java/org/apache/blur/lucene/search/FacetQuery.java
index cb2c482..b813a0e 100644
--- a/blur-query/src/main/java/org/apache/blur/lucene/search/FacetQuery.java
+++ b/blur-query/src/main/java/org/apache/blur/lucene/search/FacetQuery.java
@@ -18,6 +18,8 @@ package org.apache.blur.lucene.search;
  */
 import java.io.IOException;
 
+import org.apache.blur.log.Log;
+import org.apache.blur.log.LogFactory;
 import org.apache.lucene.index.AtomicReaderContext;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.search.Explanation;
@@ -143,6 +145,8 @@ public class FacetQuery extends AbstractWrapperQuery {
 
   public static class FacetScorer extends Scorer {
 
+    private static final Log LOG = LogFactory.getLog(FacetScorer.class);
+
     private final Scorer _baseScorer;
     private final OpenBitSet _hit;
 
@@ -156,6 +160,10 @@ public class FacetQuery extends AbstractWrapperQuery {
       if (doc == NO_MORE_DOCS) {
         return doc;
       }
+      if (doc < 0) {
+        LOG.error("DocId from base scorer < 0 [{0}]", _baseScorer);
+        return doc;
+      }
       _hit.fastSet(doc);
       return doc;
     }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/df6d7f29/blur-query/src/main/java/org/apache/blur/lucene/search/SuperQuery.java
----------------------------------------------------------------------
diff --git a/blur-query/src/main/java/org/apache/blur/lucene/search/SuperQuery.java b/blur-query/src/main/java/org/apache/blur/lucene/search/SuperQuery.java
index 5fbe70e..a8b6760 100644
--- a/blur-query/src/main/java/org/apache/blur/lucene/search/SuperQuery.java
+++ b/blur-query/src/main/java/org/apache/blur/lucene/search/SuperQuery.java
@@ -319,6 +319,13 @@ public class SuperQuery extends AbstractWrapperQuery {
       // if not too costly to calculate.
       return scorer.cost();
     }
+
+    @Override
+    public String toString() {
+      return "SuperScorer [originalQueryStr=" + originalQueryStr + ", scorer=" + scorer +
", scoreType=" + scoreType
+          + "]";
+    }
+
   }
 
   public Query getQuery() {


Mime
View raw message