lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Gelderbloem" <Peter.Gelderbl...@mediasurface.com>
Subject RE: Case-sensitive search
Date Fri, 19 Aug 2005 11:11:56 GMT
I don't really need this at the moment, but need to know:

Is it conceivable to make a configurable analyzer with dynamically added
filters?

Peter 
-----Original Message-----
From: Erik Hatcher [mailto:erik@ehatchersolutions.com] 
Sent: 19 August 2005 01:50
To: java-user@lucene.apache.org
Subject: Re: Case-sensitive search


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


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