diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/blocktree/SegmentTermsEnumFrame.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/blocktree/SegmentTermsEnumFrame.java index 11e88c24b020..5c8b95896914 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/blocktree/SegmentTermsEnumFrame.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/blocktree/SegmentTermsEnumFrame.java @@ -767,7 +767,6 @@ public SeekStatus scanToTermNonLeaf(BytesRef target, boolean exactOnly) throws I // ToStringUtils.bytesRefToString(suffixBytesRef)); // } - final int termLen = prefix + suffix; startBytePos = suffixesReader.getPosition(); suffixesReader.skipBytes(suffix); ste.termExists = (code & 1) == 0; @@ -806,7 +805,7 @@ public SeekStatus scanToTermNonLeaf(BytesRef target, boolean exactOnly) throws I // us to position to the next term after // the target, so we must recurse into the // sub-frame(s): - ste.currentFrame = ste.pushFrame(null, ste.currentFrame.lastSubFP, termLen); + ste.currentFrame = ste.pushFrame(null, ste.currentFrame.lastSubFP, prefix + suffix); ste.currentFrame.loadBlock(); while (ste.currentFrame.next()) { ste.currentFrame = ste.pushFrame(null, ste.currentFrame.lastSubFP, ste.term.length());