lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
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,

-----Original Message-----
From: Daniel Naber [] 
Sent: Monday, September 25, 2006 01:45 PM
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.



To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message