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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to