Searching for special characters using Lucene standard Query Parser
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Harisankar_Parameswaran
Posted On:   Tuesday, February 22, 2005 05:11 AM


Hi,

Im currently using Lucene for searching purposes. Im using a Standard Analyzer and the standard QueryParser.


My search text contains characters such as $, @, % etc which are NOT part of the Lucene special character set. So when i give a search for "$50", I get "50%" as well. How can i get it to behave exactly as I want or is this a limitation with the standard Queryparser ie should i customise it


Thanks

Re: Searching for special characters using Lucene standard Query Parser

Posted By:   Otis_Gospodnetic  
Posted On:   Tuesday, February 22, 2005 05:34 PM

$50 and 50% end up being indexed the same way, as '50', since StandardAnalyzer strips characters like $ and %. If you want those to be distinct, you have to use an Analyzer that keeps these tokens distinct from each other.
About | Sitemap | Contact