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 Rakesh Shete <ra...@hotmail.com> on 2008/01/12 11:27:54 UTC
Matching symbols like #,$,@
Hi all,
I want to match a string like "ABC#$" with "ABC#$@%@$^@$^@".
The query string generated by QueryParse is as follows:
title:ABC#$*
I
append the "*" so that it becomes a wild card search. It does not
return me any records. I did try escaping '#' and '$'. But that too
does not work.
I checked the list of special symbols that can be escaped and the above two don't fall under it.
If modify the search to match "ABC" with querystring as title:ABC* then it does return me the result as "ABC#$@%@$^@$^@".
Am I missing something here? How do I tell Lucene to match symbols like '#', '$', etc.
--Regards,
Rakesh S
_________________________________________________________________
Post free property ads on Yello Classifieds now! www.yello.in
http://ss1.richmedia.in/recurl.asp?pid=220
Re: Matching symbols like #,$,@
Posted by Erick Erickson <er...@gmail.com>.
What analyzer are you using to index? And is it a different analyzer
when indexing as opposed to searching?
Get a copy of Luke and look in your index to see what is
*actually* indexed. At that point, you can start worrying about
how the query is parsed. Until you know what's in your index,
you're flying blind.
Best
Erick
On Jan 12, 2008 5:27 AM, Rakesh Shete <ra...@hotmail.com> wrote:
>
>
>
>
> Hi all,
>
> I want to match a string like "ABC#$" with "ABC#$@%@$^@$^@".
>
> The query string generated by QueryParse is as follows:
>
> title:ABC#$*
>
> I
> append the "*" so that it becomes a wild card search. It does not
> return me any records. I did try escaping '#' and '$'. But that too
> does not work.
> I checked the list of special symbols that can be escaped and the above
> two don't fall under it.
>
> If modify the search to match "ABC" with querystring as title:ABC* then it
> does return me the result as "ABC#$@%@$^@$^@".
>
> Am I missing something here? How do I tell Lucene to match symbols like
> '#', '$', etc.
>
> --Regards,
> Rakesh S
> _________________________________________________________________
> Post free property ads on Yello Classifieds now! www.yello.in
> http://ss1.richmedia.in/recurl.asp?pid=220