We've run into a situation where having NOT NEAR queries would really
help. I haven't been able to find any discussion of adding this to Lucene in
the past, so wanted to ask if people had any comments about it before I
started trying to make the change.
I've looked at NearSpansUnordered and it
Sounds like you just want a BUTNOT of a NearSpan.
There is no Span support in the Lucene query language, but if there where:
*:* BUTNOT NearSpan(foo, bar, 10)
(or does lucene call it ANDNOT...)
Dave Golombek wrote:
We've run into a situation where having NOT NEAR queries would really
help. I
Dave,
One can use SpanNotQuery to get NOT NEAR by using this generalized structure:
SpanNot(foo, SpanNear(foo, bar, distance))
This also allows for example:
SpanNot(two, SpanNear(one, three, distance))
Btw. I don't know of any query language that has this second form.
AND NOT normally does
From: Paul Elschot
One can use SpanNotQuery to get NOT NEAR by using this generalized
structure:
SpanNot(foo, SpanNear(foo, bar, distance))
This also allows for example:
SpanNot(two, SpanNear(one, three, distance))
Btw. I don't know of any query language that has this second form.