lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject svn commit: r819638 - /lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/HTMLStripTransformer.java
Date Mon, 28 Sep 2009 16:44:26 GMT
Author: shalin
Date: Mon Sep 28 16:44:26 2009
New Revision: 819638

URL: http://svn.apache.org/viewvc?rev=819638&view=rev
Log:
Use HTMLStripCharFilter instead of deprecated HTMLStripReader

Modified:
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/HTMLStripTransformer.java

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/HTMLStripTransformer.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/HTMLStripTransformer.java?rev=819638&r1=819637&r2=819638&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/HTMLStripTransformer.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/HTMLStripTransformer.java
Mon Sep 28 16:44:26 2009
@@ -16,10 +16,12 @@
  */
 package org.apache.solr.handler.dataimport;
 
-import org.apache.solr.analysis.HTMLStripReader;
+import org.apache.solr.analysis.HTMLStripCharFilter;
+import org.apache.lucene.analysis.CharReader;
 
 import java.io.IOException;
 import java.io.StringReader;
+import java.io.BufferedReader;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -29,7 +31,7 @@
  * in case you don't need this HTML anyway.
  *
  * @version $Id$
- * @see org.apache.solr.analysis.HTMLStripReader
+ * @see org.apache.solr.analysis.HTMLStripCharFilter
  * @since solr 1.4
  */
 public class HTMLStripTransformer extends Transformer {
@@ -73,7 +75,7 @@
     StringBuilder out = new StringBuilder();
     StringReader strReader = new StringReader(value);
     try {
-      HTMLStripReader html = new HTMLStripReader(strReader);
+      HTMLStripCharFilter html = new HTMLStripCharFilter(CharReader.get(strReader.markSupported()
? strReader : new BufferedReader(strReader)));
       char[] cbuf = new char[1024 * 10];
       while (true) {
         int count = html.read(cbuf);



Mime
View raw message