lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chuck Williams <>
Subject Re: wildcarded phrase queries
Date Wed, 06 Apr 2005 06:19:20 GMT
Erik Hatcher writes (4/5/2005 5:57 PM):

> I have a need to implement wildcarded phrase queries, such as this:
>     "apach? luc*"
> which would match "apache lucene", for example.  This needs to also 
> support ordered and unordered proximity like SpanNearQuery does:
>     "apach? luc*"~10
> I presume I'm going to have to key off of SpanQuery with a some 
> specialized subclasses.
> What approach do you recommend for implementing something like this?

Hi Erik,

Might it be as easy as creating a SpanWilcardQuery that transforms into 
a SpanOrQuery of SpanTermQuery's, and then use a SpanNearQuery of 
SpanWildcardQuery's?  You could use a generate the 
list of terms for the SpanOrQuery.  This would have some issues like 
computing the idf as the sum of all the pattern-matched terms, but it 
looks like that issue still exists with WildcardQuery too.  I haven't 
done much with SpanQuery's so this might not work out so simply, or be 
acceptably efficient.


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

View raw message