Skip to content

Commit 8c0bab6

Browse files
committed
iter
1 parent 955316d commit 8c0bab6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

server/src/main/java/org/elasticsearch/index/codec/tsdb/es819/ES819TSDBDocValuesProducer.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -487,9 +487,7 @@ BlockLoader.Block tryReadAHead(BlockLoader.BlockFactory factory, BlockLoader.Doc
487487

488488
@Override
489489
public void lookupOrds(int[] sortedOrds, int uniqueCount, TermConsumer consumer) throws IOException {
490-
// termsEnum.lookupOrds(sortedOrds, uniqueCount, consumer);
491-
var r = new BulkOrdinalLookup(entry.termsDictEntry, data, merging);
492-
r.lookupOrds(sortedOrds, uniqueCount, consumer);
490+
termsEnum.lookupOrds(sortedOrds, uniqueCount, consumer);
493491
}
494492
}
495493

@@ -676,7 +674,11 @@ public BytesRef next() throws IOException {
676674
if (++ord >= entry.termsDictSize) {
677675
return null;
678676
}
677+
readTerm();
678+
return term;
679+
}
679680

681+
void readTerm() throws IOException {
680682
if ((ord & blockMask) == 0L) {
681683
decompressBlock();
682684
} else {
@@ -693,7 +695,6 @@ public BytesRef next() throws IOException {
693695
term.length = prefixLength + suffixLength;
694696
input.readBytes(term.bytes, prefixLength, suffixLength);
695697
}
696-
return term;
697698
}
698699

699700
@Override
@@ -735,7 +736,8 @@ void lookupOrds(int[] sortedOrds, int uniqueCount, BlockLoader.BulkOrdinalLookup
735736
}
736737
// Scan to the looked up ord
737738
while (this.ord < targetOrd) {
738-
next();
739+
ord++;
740+
readTerm();
739741
}
740742
consumer.onTerm(offset, term);
741743
}

0 commit comments

Comments
 (0)