lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Rodenburg <jeff.rodenb...@gmail.com>
Subject Re: Using analyzers with term queries
Date Tue, 25 Oct 2005 13:46:18 GMT
I don't mean to take the thread off-topic, but is this the recommended
approach for any of the Query objects, i.e. SpanQuery or PhraseQuery?


On 10/25/05, Erik Hatcher <erik@ehatchersolutions.com> wrote:
>
>
> On 25 Oct 2005, at 07:00, Rob Young wrote:
> > I am using TermQuery s (and FuzzyQuery s) on the searching side and
> > I would like to keep doing so. However, I would like to use the
> > MetaphoneReplacementAnalyzer (from Lucene in Action) when indexing.
> > How can I allow for this in searching if I'm using TermQuery?
>
> You could simply call the metaphone .encode method on the text before
> constructing a Term for TermQuery. Or, alternatively, you could run
> the Analyzer on the String (using a StringReader) and capture the
> token(s) that come back to formulate the TermQuery(s).
>
> 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