lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Phonetic search with Lucene 3.2
Date Tue, 08 Nov 2011 12:06:40 GMT

On Nov 8, 2011, at 03:58 , Felipe Carvalho wrote:

> One other question: I'm looking at Lucene 3.4 javadocs (
> but I can't find
> MetaphoneReplacementAnalyzer anywhere. Does any one know if this class has
> been removed from lucene-core.

That class is in Lucene in Action's companion code, not Lucene itself.  Download it from

> My Lucene In Action edition is from 2004, so I'm guessing things kinda
> changed since then.

There's a second edition out now, well worth getting if I do say so myself :)  (I've learned
a lot from reading and re-reading it myself, to be honest - thanks MikeM!)

>> Now suppose my document had a particular field I don't want to be
>> metaphones one the search, for instance, "exactName". For example, suppose
>> I want to look for all documents which contents phonetically match "kool
>> kat" and exactName match "kat" but not "cat", generating an expression like
>> this: "exactName:kat AND contents:kool kat".
>> Is it possible to do this? If so, how would I do it? Can I use specific
>> analyzers for each field?

Yes, quite possible, including boosting on exact matches if you want.  Use a BooleanQuery
to wrap clauses parsed once with phonetic analysis, and once without, including fields at
indexing time for both too of course.


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

View raw message