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 Fri, 19 Aug 2005 00:50:17 GMT

On Aug 18, 2005, at 6:22 PM, tareque@controldocs.com wrote:

>> On Thu, 2005-08-18 at 17:16, tareque@controldocs.com wrote:
>>
>>> 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.
>>>
>>
>> You need to use the same analyzer for parsing queries as you do for
>> indexing content.
>>
>> Luke Francl
>>
>>
>
> Actually I have used StopAn for indexing. So used the same for parsing
> queries, but it's still converting the queries to lowercase before  
> running
> the actually search

Both of those analyzers lowercase.  When you said it was working,  
what did you mean?   To prevent lowercasing and get stop words  
removed you *will* have to write a custom analyzer.  Also keep in  
mind that StopFilter is case-sensitive and that the stop word list is  
all lowercase - so you will need to account for this with a custom  
stop filter probably too.

It is highly recommended to "analyze the analyzer" - a topic covered  
in depth in the Analysis chapter in Lucene in Action, and one of my  
java.net articles.

     Erik


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