lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Miller <markrmil...@gmail.com>
Subject Re: Problem using wildcardsearch in phrase search
Date Sun, 13 May 2007 01:17:21 GMT

>
>
> Perhaps not like whitespaceanalyzer does in all cases, but this code
>
>            QueryParser qp = new QueryParser("field", new
> WhitespaceAnalyzer());
>
>            Query q = qp.parse("Does this tokenize*");
>            System.out.println(q.toString());
>
> produces
>
> field:Does field:this field:tokenize*
>
>
>
> while this code
>            QueryParser qp = new QueryParser("field", new
> KeywordAnalyzer());
>
>            Query q = qp.parse("Does this tokenize*");
>            System.out.println(q.toString());
>
>
> Produces:
> field:Does field:this field:tokenize*
>
> The only difference is using KeywordAnalyzer rather than 
> WhitespaceAnalyzer.
>
> I sure don't see the difference, and it's puzzled me on and off.
>
> Erick
QueryParser breaks up "Does this tokenize*" before it even gets to the 
Analyzer...each space separated term is fed to the analyzer one at a 
time...unless they are surrounded in quotes in which case the whole 
string in the quotes is fed into the analyzer.

- Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message