You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Damian Birchler <Da...@bsiag.com> on 2012/08/27 16:30:19 UTC

Use an analyzer with Term, FuzzyQuery, BooleanQuery and friends

Hello list

I build my queries programmatically with Term, NumericTerm, FuzzyQuery, BooleanQuery etc. In particular, I do not use QueryParser to build my query from a string. Still, I would like to first run the values for my terms through an analzyer (more precisely, the same analyzer that I use for indexing) on my values for the terms. How would I do this?

Thanks a lot,
Damian


Re: Use an analyzer with Term, FuzzyQuery, BooleanQuery and friends

Posted by Jack Krupansky <ja...@basetechnology.com>.
See:
http://mail-archives.apache.org/mod_mbox/lucene-java-user/201208.mbox/%3C42B9AA72526143469066683A1A2FE86A95AB00@CLG-Exch1.CLG.Local%3E 

Just plug in whatever analyzer you use for indexing.

-- Jack Krupansky

From: Damian Birchler 
Sent: Monday, August 27, 2012 10:30 AM
To: mailto:java-user@lucene.apache.org 
Subject: Use an analyzer with Term, FuzzyQuery, BooleanQuery and friends

Hello list

 

I build my queries programmatically with Term, NumericTerm, FuzzyQuery, BooleanQuery etc. In particular, I do not use QueryParser to build my query from a string. Still, I would like to first run the values for my terms through an analzyer (more precisely, the same analyzer that I use for indexing) on my values for the terms. How would I do this?

 

Thanks a lot,

Damian