On Jul 30, 2004, at 7:01 AM, Lucene wrote:
I was wondering is there is a way to do proximity searches with phrases
eg "very good" NEAR "sometimes".

Any help on this would be welcome.

You can do this with the new SpanQuery family in v1.4. The example you gave would consist of a SpanTermQuery for "very", "good", and "sometimes", with the first two combined with a SpanNearQuery (with no slop, in order), and finally the "very good" SpanNearQuery combined with another SpanNearQuery with the "sometimes" SpanTermQuery. *whew* :)


There is no QueryParser support (yet) for such constructs, so doing this with the API directly is necessary. There has been a contribution of a new parser that can work with SpanQuery which probably should be put in the sandbox soon.

        Erik


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to