In general, just escape things. See:
http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Escaping Special
Characters

<http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Escaping Special
Characters>But I have to say that you might want to consider carefully
whether
this is a good idea. Do your users really expect
"search for quoted phrase" to fail to match "search for "quoted" phrase"?

And how will you figure out what to quote? Or will you *require* that users
enter completely syntactically correct searches? That is, will
"search for "quoted phrase" be transformed into
"search for "quoted" phrase" or "search for "quoted phrase""?

You may be better off just dropping everything that's not alphanum from
your processing....

Best
Erick

On Mon, Nov 22, 2010 at 12:39 AM, Pawan Darira <pawan.dar...@gmail.com>wrote:

> Hi
>
> I want to do pharse searching with single/double quotes. Also there are
> cases that those phrases include special characters like & etc.
>
> What all i need to do while indexing such special characters & while
> searching them. How to handle phrase search with quotes
>
> Please suggest
>
> --
> Thanks,
> Pawan Darira
>

Reply via email to