lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Null or no analyzer
Date Wed, 20 Oct 2004 15:28:45 GMT

On Oct 20, 2004, at 9:55 AM, Aviran wrote:
> AFIK if the term "Election 2004" will be between quotation marks this 
> should
> work fine.

No, it won't.  The Analyzer will analyze it, and the WhitespaceAnalyzer 
would split it into two tokens [Election] and [2004].

This is a tricky situation with no clear *best* way to do this sort of 
thing.  However, given what I've seen of this thread so far I'd 
recommend using the PerFieldAnalyzerWrapper and associate the fields 
indexed as Field.Keyword with a KeywordAnalyzer.  There have been some 
variants of this posted on the list - it is not included in the API, 
however perhaps it should be.  Or perhaps there are other options to 
solve this recurring dilemma folks have with Field.Keyword indexed 
fields and QueryParser?


> Aviran
> -----Original Message-----
> From: Morus Walter []
> Sent: Wednesday, October 20, 2004 2:25 AM
> To: Lucene Users List
> Subject: RE: Null or no analyzer
> Aviran writes:
>> You can use WhiteSpaceAnalyzer
> Can he? If "Elections 2004" is one token in the subject field 
> (keyword),
> this will fail, since WhiteSpeceAnalyzer will tokenize that to 
> `Elections'
> and `2004'.
> So I guess he has to write an identity analyzer himself unless there 
> is one
> provided (which doesn't seem to be the case). The only alternatives 
> are not
> using query parser or extending query parser for a key word syntax, as 
> far
> as I can see.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message