Thanks for your reply. Is there any sample code that would demonstrate how to use these classes properly to get the desired effect of what im looking for?
Thanks -----Original Message----- From: Erik Hatcher [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 10, 2006 11:00 AM To: java-user@lucene.apache.org Subject: Re: wildcards in phrase searches 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]