vsop-479 commented on code in PR #13253: URL: https://github.com/apache/lucene/pull/13253#discussion_r1615650665
########## lucene/core/src/java/org/apache/lucene/codecs/lucene90/blocktree/SegmentTermsEnum.java: ########## @@ -710,8 +761,28 @@ public SeekStatus seekCeil(BytesRef target) throws IOException { // System.out.println(" target is before current (shares prefixLen=" + targetUpto + "); // rewind frame ord=" + lastFrame.ord); // } + + // We got lastFrame by comparing target and term, and target less than last seeked term in + // currentFrame. If lastFrame's fp is same with currentFrame's fp, we can reduce entCount to + // nextEnt. Review Comment: > We don't seem to reduce entCount anymore? We can reduce entCount to nextEnt if we finally seek the same block. This has been already implemented in: ```` // We still stay on withOutReload frame, reduce entCount to nextEnt. int origEntCount = -1; if (currentFrame.fp == withOutReloadFp && origNextEnt != 0) { origEntCount = currentFrame.entCount; currentFrame.entCount = origNextEnt; } ```` ########## lucene/core/src/java/org/apache/lucene/codecs/lucene90/blocktree/SegmentTermsEnum.java: ########## @@ -518,7 +541,20 @@ public boolean seekExact(BytesRef target) throws IOException { currentFrame.loadBlock(); + // We still stay on withOutReload frame, reduce entCount to nextEnt. + int origEntCount = -1; + if (currentFrame.fp == withOutReloadFp && origNextEnt != 0) { + origEntCount = currentFrame.entCount; + currentFrame.entCount = origNextEnt; + } + final SeekStatus result = currentFrame.scanToTerm(target, true); + + // Revert entCount to origEntCount. Review Comment: Done. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org