mirror of https://github.com/apache/lucene.git
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:
parent
6a1e2c9b14
commit
3ac4b568cc
|
@ -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>());
|
||||
|
|
Loading…
Reference in New Issue