lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Case-sensitive search
Date Thu, 18 Aug 2005 20:20:49 GMT
On Aug 18, 2005, at 4:16 PM, tareque@controldocs.com wrote:
> Thanks! I have used StopAnalyzer to index. Does it lower-case before
> indexing? I don't touch the query string before sending for  
> searching, so
> the query string is not lower-cases.

Pretty much all built-in Lucene analyzers lower-case:

     http://svn.apache.org/repos/asf/lucene/java/trunk/src/java/org/ 
apache/lucene/analysis/StopAnalyzer.java
(scroll to the bottom to see the tokenStream method - the heart of an  
analyzer)

The exception is the WhitespaceAnalyzer, which is probably not what  
you want to use.  You can write your own Analyzer (copy/paste one and  
remove the lowercasing filter - though some analyzers use a  
lowercasing tokenizer, not a filter).

     Erik



>
>
>> The search really is case sensitive, it's just that all input is
>> usually lower-cased, so it feels like it's case insensitive.  In  
>> other
>> words, don't lower-case your input before indexing, and don't
>> lower-case your queries (i.e. pick an Analyzer that doesn't
>> lower-case).
>>
>> Otis
>>
>>
>> --- tareque@controldocs.com wrote:
>>
>>
>>> Is there any way to do a case-sensitive search?
>>>
>>> Thanks
>>> Tareque
>>> ControlDOCS
>>>
>>>
>>> -------------------------------------------------------------------- 
>>> -
>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message