lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r432443 - in /lucene/java/trunk: CHANGES.txt src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java
Date Fri, 18 Aug 2006 00:16:42 GMT
Author: yonik
Date: Thu Aug 17 17:16:42 2006
New Revision: 432443

URL: http://svn.apache.org/viewvc?rev=432443&view=rev
Log:
fix getPositionIncrement: LUCENE-659

Modified:
    lucene/java/trunk/CHANGES.txt
    lucene/java/trunk/src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?rev=432443&r1=432442&r2=432443&view=diff
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Thu Aug 17 17:16:42 2006
@@ -107,6 +107,9 @@
 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

Modified: lucene/java/trunk/src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java?rev=432443&r1=432442&r2=432443&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java Thu
Aug 17 17:16:42 2006
@@ -74,6 +74,14 @@
     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 + ")";
   }



Mime
View raw message