Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ public boolean advanceExact(int doc) throws IOException {

@Override
public int docValueCount() {
return values.docValueCount();
// If we don't have ordinals, then we just have the missing value
return hasOrds ? values.docValueCount() : 1;
}

@Override
Expand Down Expand Up @@ -359,7 +360,8 @@ public long getValueCount() {

@Override
public int docValueCount() {
return Math.max(1, values.docValueCount());
// If we don't have ordinals, then we just have the missing value
return hasOrds ? values.docValueCount() : 1;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public long nextOrd() {
if (i < ords[doc].length) {
return ords[doc][i++];
} else {
return NO_MORE_DOCS;
throw new IllegalStateException();
}
}

Expand All @@ -175,13 +175,13 @@ public int docValueCount() {
for (int i = 0; i < numDocs; ++i) {
assertTrue(withMissingReplaced.advanceExact(i));
if (ords[i].length > 0) {
assertEquals(ords[i].length, withMissingReplaced.docValueCount());
for (int ord : ords[i]) {
assertEquals(values[ord], withMissingReplaced.lookupOrd(withMissingReplaced.nextOrd()));
}
assertEquals(SortedSetDocValues.NO_MORE_DOCS, withMissingReplaced.nextOrd());
} else {
assertEquals(1, withMissingReplaced.docValueCount());
assertEquals(missing, withMissingReplaced.lookupOrd(withMissingReplaced.nextOrd()));
assertEquals(SortedSetDocValues.NO_MORE_DOCS, withMissingReplaced.nextOrd());
}
}
}
Expand Down
Loading