lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ahmet Arslan <iori...@yahoo.com>
Subject Re: how to implement search including special characters?
Date Fri, 30 Sep 2011 09:00:06 GMT
>         in my application i need to
> implement search functionality with
> included special characters 
> 
> ex1:if i enter search term as "(PAGE)" i am getting
> results, if i enter
> search term as "()" i am getting error .
> ex2: eventhough if i enter "{","}","@","$","%".....i need
> to get search
> results those are having that symbols
> 

Here are some possible solutions :

1-) use lucene query parser and escape all of the special characters. (There is a static method
for this in QueryParser class)
2-) use dismax query parser and escape '+', '-' and '"'. Note that dismax automatically escapes
remaining special characters.
3-) use termQParserPlugin or rawQParserPlugin

Mime
View raw message