switch analysis.jsp to use reusable tokenstreams to match indexing and querying usage

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@809369 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2009-08-30 16:18:21 +00:00
parent 6a1e2c9b14
commit 3ac4b568cc
1 changed files with 4 additions and 2 deletions

View File

@ -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>());