mirror of https://github.com/apache/lucene.git
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:
parent
8e3608845d
commit
fa293670a1
|
@ -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
|
||||
|
|
|
@ -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 + ")";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue