lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Moray McConnachie \(OA\)" <>
Subject Re: Indexing multiple instances of the same field for each docume nt
Date Sat, 28 Feb 2004 22:38:30 GMT
----- Original Message ----- 
From: "Erik Hatcher" <>
To: "Lucene Users List" <>
Sent: Friday, February 27, 2004 4:07 PM
Subject: Re: Indexing multiple instances of the same field for each docume

> > Does this mean that whenever I want to do keyword searches, I must
> > avoid
> > QueryParser?
> Not necessarily.  This is a bit of an involved issue, and I posted a
> more extensive reply on this a few weeks ago (pasting a bit of our
> Lucene in Action discussion on it - perhaps search for
> "KeywordAnalyzer" to find that mail)
> Look into PerFieldAnalyzerWrapper.

Thanks for this tip, I've mostly done it now using this route - I guess one
could also derive a new Analyzer that does a switch on the basis of
FieldName but that wouldn't be so flexible.

I see from the DocumentWriter class that all keyword fields are indexed
exactly, including case-sensitivity. This really tripped me up, since my
version of the KeywordAnalyzer (left by Eric as an exercise to the reader)
was applying the LowerCaseFilter, and therefore I got no matches.

I guess the best way to handle this problem, other than getting the
application to transform values prior to query or indexing, is actually to
tokenize the field after all, but use the same KeywordAnalyzer to do it!

Moray McConnachie

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

View raw message