On May 10, 2006, at 1:47 PM, [EMAIL PROTECTED] wrote:
Is it possible to have wildcards in a phrase search? For example,
if my
object is indexed with a phrase "benchmark properties", is there a
way to
specify a phrase search that uses wildcards, such as "benchmar*
properties"
or "benchmark pro*"? I have tried using WildcardQuery, but it
doesnt seem to
work with phrases, only single terms. Using the QueryParser doesnt
seem to
work either, and ive tried it with the StandardAnalyzer and
KeywordAnalyzer.
Perhaps there is something simple Im missing here. Has anyone
gotten this to
work?
It's a fair bit trickier than using any of the stock core classes
like that. But it can be done, using SpanNearQuery nested with
SpanRegexQuery's for the wildcarded parts in the contrib code (note,
this uses regex syntax, not WildcardQuery syntax), along with
SpanTermQuery's for the non-wildcarded parts.
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]