lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r809369 - /lucene/solr/trunk/src/webapp/web/admin/analysis.jsp
Date Sun, 30 Aug 2009 16:18:21 GMT
Author: yonik
Date: Sun Aug 30 16:18:21 2009
New Revision: 809369

URL: http://svn.apache.org/viewvc?rev=809369&view=rev
Log:
switch analysis.jsp to use reusable tokenstreams to match indexing and querying usage

Modified:
    lucene/solr/trunk/src/webapp/web/admin/analysis.jsp

Modified: lucene/solr/trunk/src/webapp/web/admin/analysis.jsp
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/web/admin/analysis.jsp?rev=809369&r1=809368&r2=809369&view=diff
==============================================================================
--- lucene/solr/trunk/src/webapp/web/admin/analysis.jsp (original)
+++ lucene/solr/trunk/src/webapp/web/admin/analysis.jsp Sun Aug 30 16:18:21 2009
@@ -149,7 +149,8 @@
     if (qval!="" && highlight) {
       Reader reader = new StringReader(qval);
       Analyzer analyzer =  field.getType().getQueryAnalyzer();
-      TokenStream tstream = analyzer.tokenStream(field.getName(),reader);
+      TokenStream tstream = analyzer.reusableTokenStream(field.getName(),reader);
+      tstream.reset();
       List<Token> tokens = getTokens(tstream);
       matches = new HashSet<Tok>();
       for (Token t : tokens) { matches.add( new Tok(t,0)); }
@@ -222,7 +223,8 @@
        }
 
      } else {
-       TokenStream tstream = analyzer.tokenStream(field.getName(),new StringReader(val));
+       TokenStream tstream = analyzer.reusableTokenStream(field.getName(),new StringReader(val));
+       tstream.reset();
        List<Token> tokens = getTokens(tstream);
        if (verbose) {
          writeHeader(out, analyzer.getClass(), new HashMap<String,String>());



Mime
View raw message