lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tare...@controldocs.com
Subject Re: Case-sensitive search
Date Thu, 18 Aug 2005 22:16:21 GMT
Thanks again! The analyzer is working now. But seems like actually the
QueryParser I am using is probably converting the queries to lowercase
first. Is there any way to stop that? Here is the line of code where I am
parsing:

Query query = QueryParser.parse(line, "contents", analyzer);

As for analyzer, I have tried both StardaAnalyzer and StopAnalyzer.



> 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
>





---------------------------------------------------------------------
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