lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lee_G...@emc.com
Subject RE: wildcards in quoted phrases?
Date Mon, 25 Sep 2006 23:34:59 GMT
I encountered this issue before and was led to use SpanQueries for
wildcards within phrases. Take a look at the SpanQuery family of
classes. SpanQueries can give you the ability to specify a wildcarded
term within a phrase since you can nest different SpanQueries within a
SpanQuery. One of these is the SpanRegexQuery, which allows you to
specify a regular expression that would serve as your wildcard term
search within the phrase. 

I ended up using a SpanNearQuery to represent the overall phrase nested
with SpanRegexQueries for the wildcarded parts, and SpanTermQueries for
all other non-wildcarded terms. 

Hope this helps,
Gary

-----Original Message-----
From: Daniel Naber [mailto:lucenelist2005@danielnaber.de] 
Sent: Monday, September 25, 2006 01:45 PM
To: java-user@lucene.apache.org
Subject: Re: wildcards in quoted phrases?

On Monday 25 September 2006 22:20, Dan Armbrust wrote:

> My hunch is that its not real easy, otherwise it would already have 
> been done...

I think it shouldn't be difficult, but to expand the PrefixQuery, your
QueryParser would need an IndexReader. Currently IndexReader/QueryParser
don't depend on each other. Maybe this is the reason why it hasn't been
done or why it hasn't been published.

Regards
 Daniel

--
http://www.danielnaber.de

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message