lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Which Analyzer to use when searching on Keyword fields
Date Wed, 05 Apr 2006 12:32:41 GMT

I presume you're asking about what Analyzer to use with QueryParser.   
QueryParser analyzes all term text, but you can fake it for Keyword  
(non-tokenized) fields by using PerFieldAnalyzerWrapper, specifying  
the KeywordAnalyzer for the fields you indexed as such.

The KeywordAnalyzer code will work with 1.4.3, so just grab that  
class and put it into your project.  A couple of variations of it are  
also included with the Lucene in Action code.


On Apr 5, 2006, at 7:52 AM, Satuluri, Venu_Madhav wrote:

> Hi,
> I am using lucene 1.4.3. Some of my fields are indexed as Keywords. I
> also have subclassed Analyzer inorder to put stemming etc. I am not  
> sure
> if the input is tokenized when I am searching on keyword fields; I  
> don't
> want it to be. Do I need to have a special case in the overridden  
> method
> (Analyzer.tokenStream() ) to handle keyword fields?
> I've noticed that there's a KeywordTokenizer now in the API, but  
> its not
> there for lucene 1.4.3. If I was using 1.9, I could probably determine
> if the field was a keyword one and then return a
> KeywordTokenizer(Reader), but I am using 1.4.3.
> Any advice is appreciated.
> -Venu
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message