You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Gong Li <ee...@gmail.com> on 2011/02/10 19:05:52 UTC

Question about Case Sensitive?!

Hi,

I use standardAnalyzer, queryParser, highlighter in my program, but they
lowercase the keywords. Now i need to search the keywords CASE SENSITIVE. Is
there any methods to achieve this and also use standardAnalyzer and
queryParser? Or some other ways? HOW???

Thx.

RE: Question about Case Sensitive?!

Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi Gong Li,

You can create your own Analyzer that does not add LowerCaseFilter to the
FilterChain. To achieve this, use the source code from Lucene source, rename
the class (e.g. org.yourpackage.NoLowercasingStandardAnalyzer) and remove
LowerCaseFilter from the tokenStream() and reuseableTokenStream() factory
methods.

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de

> -----Original Message-----
> From: Gong Li [mailto:ee07b381@gmail.com]
> Sent: Thursday, February 10, 2011 7:06 PM
> To: java-user@lucene.apache.org
> Subject: Question about Case Sensitive?!
> 
> Hi,
> 
> I use standardAnalyzer, queryParser, highlighter in my program, but they
> lowercase the keywords. Now i need to search the keywords CASE
> SENSITIVE. Is there any methods to achieve this and also use
> standardAnalyzer and queryParser? Or some other ways? HOW???
> 
> Thx.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org