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 WildcardTermEnum.to 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.
Chuck
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]