You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jp...@apache.org on 2016/10/03 07:34:18 UTC

[2/2] lucene-solr:master: LUCENE-7459: LegacyNumericDocValuesWrapper should check the value before the bits for docs that have a value.

LUCENE-7459: LegacyNumericDocValuesWrapper should check the value before the bits for docs that have a value.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/d0ff2d27
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/d0ff2d27
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/d0ff2d27

Branch: refs/heads/master
Commit: d0ff2d2735170b226e1fead100b9a4c0c0dcb50a
Parents: cc4c780
Author: Adrien Grand <jp...@gmail.com>
Authored: Mon Oct 3 09:14:06 2016 +0200
Committer: Adrien Grand <jp...@gmail.com>
Committed: Mon Oct 3 09:33:59 2016 +0200

----------------------------------------------------------------------
 .../org/apache/lucene/index/LegacyNumericDocValuesWrapper.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d0ff2d27/lucene/core/src/java/org/apache/lucene/index/LegacyNumericDocValuesWrapper.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/LegacyNumericDocValuesWrapper.java b/lucene/core/src/java/org/apache/lucene/index/LegacyNumericDocValuesWrapper.java
index d9c997c..64108e1 100644
--- a/lucene/core/src/java/org/apache/lucene/index/LegacyNumericDocValuesWrapper.java
+++ b/lucene/core/src/java/org/apache/lucene/index/LegacyNumericDocValuesWrapper.java
@@ -30,6 +30,7 @@ public final class LegacyNumericDocValuesWrapper extends NumericDocValues {
   private final LegacyNumericDocValues values;
   private final int maxDoc;
   private int docID = -1;
+  private long value;
   
   public LegacyNumericDocValuesWrapper(Bits docsWithField, LegacyNumericDocValues values) {
     this.docsWithField = docsWithField;
@@ -51,7 +52,8 @@ public final class LegacyNumericDocValuesWrapper extends NumericDocValues {
   public int nextDoc() {
     docID++;
     while (docID < maxDoc) {
-      if (docsWithField.get(docID)) {
+      value = values.get(docID);
+      if (value != 0 || docsWithField.get(docID)) {
         return docID;
       }
       docID++;
@@ -82,7 +84,7 @@ public final class LegacyNumericDocValuesWrapper extends NumericDocValues {
 
   @Override
   public long longValue() {
-    return values.get(docID);
+    return value;
   }
 
   @Override