diff --git a/src/java/org/apache/lucene/search/PrefixTermEnum.java b/src/java/org/apache/lucene/search/PrefixTermEnum.java index e80595fcd09..e2318c2c2ef 100644 --- a/src/java/org/apache/lucene/search/PrefixTermEnum.java +++ b/src/java/org/apache/lucene/search/PrefixTermEnum.java @@ -15,7 +15,7 @@ import org.apache.lucene.index.Term; */ public class PrefixTermEnum extends FilteredTermEnum { - private Term prefix; + private final Term prefix; private boolean endEnum = false; public PrefixTermEnum(IndexReader reader, Term prefix) throws IOException { @@ -31,6 +31,10 @@ public class PrefixTermEnum extends FilteredTermEnum { protected boolean endEnum() { return endEnum; } + + protected Term getPrefixTerm() { + return prefix; + } protected boolean termCompare(Term term) { if (term.field() == prefix.field() && term.text().startsWith(prefix.text())) {