Index: src/java/org/apache/lucene/index/SegmentTermEnum.java =================================================================== --- src/java/org/apache/lucene/index/SegmentTermEnum.java (revision 710047) +++ src/java/org/apache/lucene/index/SegmentTermEnum.java (working copy) @@ -160,6 +160,17 @@ } return count; } + + /** Optimized skipTo, without allocating new terms. */ + public boolean skipTo(Term target) throws IOException { + scanBuffer.set(target); + while (next()) { + if(termBuffer.compareTo(scanBuffer) >= 0){ + return true; + } + } + return false; + } /** Returns the current Term in the enumeration. Initially invalid, valid after next() called for the first time.*/