mirror of https://github.com/apache/lucene.git
don't try to remap empty ord in slow-wrapper
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1516454 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3902a2f379
commit
fb9bb2d437
|
@ -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
|
||||
|
|
|
@ -121,6 +121,9 @@ public class TestMultiDocValues extends LuceneTestCase {
|
|||
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();
|
||||
|
@ -140,7 +143,7 @@ public class TestMultiDocValues extends LuceneTestCase {
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue