lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1516455 - in /lucene/dev/branches/branch_4x: ./ lucene/ lucene/core/ lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java lucene/core/src/test/org/apache/lucene/index/TestMultiDocValues.java
Date Thu, 22 Aug 2013 14:10:58 GMT
Author: rmuir
Date: Thu Aug 22 14:10:57 2013
New Revision: 1516455

URL: http://svn.apache.org/r1516455
Log:
don't try to remap empty ord in slow-wrapper

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/lucene/   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/TestMultiDocValues.java

Modified: lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java?rev=1516455&r1=1516454&r2=1516455&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java
(original)
+++ lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java
Thu Aug 22 14:10:57 2013
@@ -450,7 +450,7 @@ public class MultiDocValues {
     public int getOrd(int docID) {
       int subIndex = ReaderUtil.subIndex(docID, docStarts);
       int segmentOrd = values[subIndex].getOrd(docID - docStarts[subIndex]);
-      return (int) mapping.getGlobalOrd(subIndex, segmentOrd);
+      return segmentOrd == -1 ? segmentOrd : (int) mapping.getGlobalOrd(subIndex, segmentOrd);
     }
  
     @Override

Modified: lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/TestMultiDocValues.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/TestMultiDocValues.java?rev=1516455&r1=1516454&r2=1516455&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/TestMultiDocValues.java
(original)
+++ lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/TestMultiDocValues.java
Thu Aug 22 14:10:57 2013
@@ -123,6 +123,9 @@ public class TestMultiDocValues extends 
     int numDocs = atLeast(500);
     for (int i = 0; i < numDocs; i++) {
       ref.copyChars(_TestUtil.randomUnicodeString(random()));
+      if (random().nextInt(7) == 0) {
+        iw.addDocument(new Document());
+      }
       iw.addDocument(doc);
       if (random().nextInt(17) == 0) {
         iw.commit();
@@ -142,7 +145,7 @@ public class TestMultiDocValues extends 
     for (int i = 0; i < numDocs; i++) {
       // check ord
       assertEquals(single.getOrd(i), multi.getOrd(i));
-      // check ord value
+      // check value
       single.get(i, expected);
       multi.get(i, actual);
       assertEquals(expected, actual);



Mime
View raw message