lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "prabin meitei" <prabin.mei...@gmail.com>
Subject Re: Problem with special charecters
Date Wed, 03 Dec 2008 09:30:26 GMT
try manually escaping the search string, adding "\" in front of the special
characters. (you can do this easily by using string replace)
This will make sure that your query contains the special characters


Prabin
toostep.com

On Wed, Dec 3, 2008 at 12:03 PM, Ravichandra <
ravichandra.thiruveedhula@fmr.com> wrote:

>
> Hi
>
> I am having problems with searching for special charecters like %,*,+,-
> etc.
> I am using standard analyzer. I create queries using the query constructor.
>
> I read in the forums and tried with QueryParser.escpae and parse methods,
> but the problem is if I have two fields as "ABC+S" and "ABC-S" and when i
> search for "ABC+S", the order of fields is "ABC+S","ABC-S", and when we
> search for "ABC-S", then also the order is "ABC+S","ABC-S".
>
> What I have seen is when we escape the search string and then parse it
> using
> query parser, the generated query doesn't contain the special charecter
> '+',
> or '-'.
>
> Please suggest me how to deal with special charecters.
>
> Lucene : 2.4
>
> Thanks
> Ravichandra
>
> -----
> Thanks
> Ravichandra
> --
> View this message in context:
> http://www.nabble.com/Problem-with-special-charecters-tp20807546p20807546.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message