LUCENE-10598: Fix docValueCount() on Lucene80 sparse sorted set doc values.

This commit is contained in:
Adrien Grand 2022-06-02 09:33:04 +02:00
parent ee99a2a452
commit 267a5fcc15
1 changed files with 12 additions and 5 deletions

View File

@ -1653,15 +1653,21 @@ final class Lucene80DocValuesProducer extends DocValuesProducer {
return disi.advanceExact(target);
}
@Override
public long nextOrd() throws IOException {
private boolean set() {
if (set == false) {
final int index = disi.index();
final long start = addresses.get(index);
this.start = start + 1;
start = addresses.get(index);
end = addresses.get(index + 1L);
set = true;
return ords.get(start);
return true;
}
return false;
}
@Override
public long nextOrd() throws IOException {
if (set()) {
return ords.get(start++);
} else if (start == end) {
return NO_MORE_ORDS;
} else {
@ -1671,6 +1677,7 @@ final class Lucene80DocValuesProducer extends DocValuesProducer {
@Override
public long docValueCount() {
set();
return end - start;
}
};