lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r903368 - in /lucene/java/trunk: CHANGES.txt src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java
Date Tue, 26 Jan 2010 19:00:11 GMT
Author: uschindler
Date: Tue Jan 26 19:00:10 2010
New Revision: 903368

URL: http://svn.apache.org/viewvc?rev=903368&view=rev
Log:
LUCENE-2235: Implement PerFieldAnalyzerWrapper.getOffsetGap

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=903368&r1=903367&r2=903368&view=diff
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Tue Jan 26 19:00:10 2010
@@ -97,6 +97,9 @@
 
 * LUCENE-2216: OpenBitSet.hashCode returned different hash codes for
   sets that only differed by trailing zeros. (Dawid Weiss, yonik)
+
+* LUCENE-2235: Implement missing PerFieldAnalyzerWrapper.getOffsetGap().
+  (Javier Godoy via Uwe Schindler)
   
 New features
 

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=903368&r1=903367&r2=903368&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 Tue
Jan 26 19:00:10 2010
@@ -17,6 +17,8 @@
  * limitations under the License.
  */
 
+import org.apache.lucene.document.Fieldable;
+
 import java.io.Reader;
 import java.io.IOException;
 import java.util.Map;
@@ -118,6 +120,15 @@
       analyzer = defaultAnalyzer;
     return analyzer.getPositionIncrementGap(fieldName);
   }
+
+  /** Return the offsetGap from the analyzer assigned to field */
+  @Override
+  public int getOffsetGap(Fieldable field) {
+    Analyzer analyzer = analyzerMap.get(field.name());
+    if (analyzer == null)
+      analyzer = defaultAnalyzer;
+    return analyzer.getOffsetGap(field);
+  }
   
   @Override
   public String toString() {



Mime
View raw message