lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felipe Carvalho <felipe.carva...@gmail.com>
Subject Re: Phonetic search with Lucene 3.2
Date Tue, 08 Nov 2011 13:42:19 GMT
On Tue, Nov 8, 2011 at 10:06 AM, Erik Hatcher <erik.hatcher@gmail.com>wrote:

>
> On Nov 8, 2011, at 03:58 , Felipe Carvalho wrote:
>
> > One other question: I'm looking at Lucene 3.4 javadocs (
> > http://lucene.apache.org/java/3_4_0/api/core/index.html) 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 http://www.manning.com/lucene
>
> > 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.
>

Would it be possible to point to an example where this is done. The best
example of a BooleanQuery I've found so far is this one:
http://www.avajava.com/tutorials/lessons/how-do-i-combine-queries-with-a-boolean-query.html

But I couldn't find a boolean query using different analyzers for different
fields of the attribute.

Thanks a lot!


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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message