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.
Aug 18, 2005, at 4:16 PM, tareque (AT) controldocs (DOT) 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:
(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).
tareque (AT) controldocs (DOT) com wrote:
Is there any way to do a case-sensitive search?
Thanks
Tareque
ControlDCS
-
To unsubscribe, e-mail: java-user-unsubscribe (AT) lucene (DOT) apache.org
For additional commands, e-mail: java-user-help (AT) lucene (DOT) apache.org
To unsubscribe, e-mail: java-user-unsubscribe (AT) lucene (DOT) apache.org
For additional commands, e-mail: java-user-help (AT) lucene (DOT) apache.org
>>
>>
>>
>
>To unsubscribe, e-mail: java-user-unsubscribe (AT) lucene (DOT) apache.org
>For additional commands, e-mail: java-user-help (AT) lucene (DOT) apache.org
>>
>
>
To unsubscribe, e-mail: java-user-unsubscribe (AT) lucene (DOT) apache.org
For additional commands, e-mail: java-user-help (AT) lucene (DOT) apache.org
To unsubscribe, e-mail: java-user-unsubscribe (AT) lucene (DOT) apache.org
For additional commands, e-mail: java-user-help (AT) lucene (DOT) apache.org