You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Filip Anselm <fi...@nable.dk> on 2005/10/07 00:09:57 UTC

searching on special characters as in "C++"

How can I make it possible to search on words that includes special
characters like + and # as in "C++" and "C#" ?

Filip


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


Re: searching on special characters as in "C++"

Posted by Chris Lamprecht <cl...@gmail.com>.
StandardAnalyzer's grammar tokenizes C# and C++ down to "C".  So you
can either use an analyzer that tokenizes differently (such as
WhitespaceAnalyzer), or modify the JavaCC grammar for StandardAnalyzer
and rebuild your own custom version.  If you go the latter route, have
a look at NutchAnalysis.jj (in the nutch project), it correctly
handles C++ and C#.

-chris

On 10/6/05, Filip Anselm <fi...@nable.dk> wrote:
> How can I make it possible to search on words that includes special
> characters like + and # as in "C++" and "C#" ?
>
> Filip
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

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