dcsimg
Supporting both case-sensitive and insensitive search
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Shyam_Eranky
Posted On:   Thursday, July 13, 2006 04:44 PM

Hi
We are using Lucene to support text based free form search. We are currently using a custom analyzer that breaks on whitespace and a few other characters and lowercases all values.
The problem is that we would like to support case insensitive search by default and in an advanced option we want to support case-sensitive search also. Since the indexing phase uses the analyzer to convert everything to lowercase we are only able to support case insensitive(In the query phase we do QueryParser.setLowercaseExpandedTerms(true);).
If we do not lowercase during indexing it becomes a case sensitive search and not case insensitive. Any help is appreciated..

Re: Supporting both case-sensitive and insensitive search

Posted By:   Otis_Gospodnetic  
Posted On:   Thursday, July 13, 2006 10:30 PM

The key is to change your tokenizer to emit not just 1 lowercased token, but 2 tokens in the same position - one lowercased, and one with original case.

If you have a copy of Lucene in Action, look at this.
About | Sitemap | Contact