Skip to content

Commit

Permalink
Fix prefix query/filter
Browse files Browse the repository at this point in the history
They should use the HashSplitterAnalyzer, not the -Search- one,
as they do not use any wildcard.
  • Loading branch information
Olivier Favre committed Apr 17, 2012
1 parent 934f231 commit 001db3d
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -442,7 +442,7 @@ public Query prefixQuery(String value, @Nullable MultiTermQuery.RewriteMethod me
// Use HashSplitterSearch* analysis and post-process it to create the real query
TokenStream tok = null;
try {
tok = searchAnalyzer.reusableTokenStream(names().indexNameClean(), new FastStringReader(value));
tok = indexAnalyzer.reusableTokenStream(names().indexNameClean(), new FastStringReader(value));
tok.reset();
} catch (IOException e) {
return null;
Expand Down Expand Up @@ -472,7 +472,7 @@ public Filter prefixFilter(String value, @Nullable QueryParseContext context) {
// Use HashSplitterSearch* analysis and post-process it to create the real filter
TokenStream tok = null;
try {
tok = searchAnalyzer.reusableTokenStream(names().indexNameClean(), new FastStringReader(value));
tok = indexAnalyzer.reusableTokenStream(names().indexNameClean(), new FastStringReader(value));
tok.reset();
} catch (IOException e) {
return null;
Expand Down

0 comments on commit 001db3d

Please sign in to comment.