lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Case-sensitive search
Date Fri, 19 Aug 2005 14:35:53 GMT
> On Aug 18, 2005, at 6:22 PM, wrote:
>>> On Thu, 2005-08-18 at 17:16, 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
> articles.
>      Erik

It's all working now. I did write a custom analyzer using the
StopAnalyzer, which correctly indexed. The problem was, when I was parsing
the query I forgot to use my new analyzer and was using the old
StopAnalyzer instead. Thanks for all the help!


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message