On Sat, Apr 11, 2009 at 10:13 AM, Sagar Khetkade <sagar.khetk...@hotmail.com
> wrote:

>
> There is a strange issue while querying on the Solr indexes. If my query
> contains the special characters like [ ] !<> etc. It is throwing the query
> parse exception. From my application interface I am able to handle the
> special characters but the issue is while the document which I am going to
> index contains any of these special characters it is throwing query parse
> exception. Can anyone give pointer over this?
> Thanks in advance.
>

You need to escape those characters. Look at
http://lucene.apache.org/java/2_4_1/queryparsersyntax.html#Escaping%20Special%20Characters

If you are using Solrj, this should be done automatically. Solrj calls
ClientUtils.escapeQueryChars under the hood.
-- 
Regards,
Shalin Shekhar Mangar.

Reply via email to