lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r805263 - /lucene/solr/trunk/src/java/org/apache/solr/analysis/TokenizerChain.java
Date Tue, 18 Aug 2009 02:50:49 GMT
Author: yonik
Date: Tue Aug 18 02:50:49 2009
New Revision: 805263

URL: http://svn.apache.org/viewvc?rev=805263&view=rev
Log:
fix char filter instantiation broken by reusable tokenstream upgrade

Modified:
    lucene/solr/trunk/src/java/org/apache/solr/analysis/TokenizerChain.java

Modified: lucene/solr/trunk/src/java/org/apache/solr/analysis/TokenizerChain.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/analysis/TokenizerChain.java?rev=805263&r1=805262&r2=805263&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/analysis/TokenizerChain.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/analysis/TokenizerChain.java Tue Aug 18 02:50:49
2009
@@ -53,6 +53,18 @@
   public TokenFilterFactory[] getTokenFilterFactories() { return filters; }
 
   @Override
+  public Reader charStream(Reader reader){
+    if( charFilters != null && charFilters.length > 0 ){
+      CharStream cs = CharReader.get( reader );
+      for (int i=0; i<charFilters.length; i++) {
+        cs = charFilters[i].create(cs);
+      }
+      reader = cs;
+    }
+    return reader;
+  }
+
+  @Override
   public TokenStreamInfo getStream(String fieldName, Reader reader) {
     Tokenizer tk = (Tokenizer)tokenizer.create(charStream(reader));
     TokenStream ts = tk;



Mime
View raw message