On 25 Oct 2005, at 09:46, Jeff Rodenburg wrote:
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?
In several applications I've built, a Query object is built via the
API using an Analyzer directly and not using QueryParser. So I
believe the answer to your question is yes. Currently QueryParser
does not support the SpanQuery family, so you'd need to do this via
the API or clever overriding of QueryParser methods in a subclass, or
creating your own parser.
How you create a Query is really dependent on the application - so
it's hard to say it's "recommended" to do it any particular way though.
Erik
On 10/25/05, Erik Hatcher <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]