fix getPositionIncrement: LUCENE-659

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@432443 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2006-08-18 00:16:42 +00:00
parent 8e3608845d
commit fa293670a1
2 changed files with 11 additions and 0 deletions

View File

@ -107,6 +107,9 @@ Bug fixes
12. LUCENE-641: fixed an off-by-one bug with IndexWriter.setMaxFieldLength()
(Daniel Naber)
13. LUCENE-659: Make PerFieldAnalyzerWrapper delegate getPositionIncrementGap()
to the correct analyzer for the field. (Chuck Williams via Yonik Seeley)
Optimizations
1. LUCENE-586: TermDocs.skipTo() is now more efficient for multi-segment

View File

@ -74,6 +74,14 @@ public class PerFieldAnalyzerWrapper extends Analyzer {
return analyzer.tokenStream(fieldName, reader);
}
/** Return the positionIncrementGap from the analyzer assigned to fieldName */
public int getPositionIncrementGap(String fieldName) {
Analyzer analyzer = (Analyzer) analyzerMap.get(fieldName);
if (analyzer == null)
analyzer = defaultAnalyzer;
return analyzer.getPositionIncrementGap(fieldName);
}
public String toString() {
return "PerFieldAnalyzerWrapper(" + analyzerMap + ", default=" + defaultAnalyzer + ")";
}