On Mon, Aug 8, 2011 at 10:00 AM, Trejkaz <[email protected]> wrote:
>
> within(5, 'my', and('cat', 'dog')) -> within(5, 'my', within(10, 'cat',
> 'dog') )
To extend my example and maybe make it a bit more hellish, take this one:
within(2, A, and(B, or(C, and(D, E))))
After rewriting both and() to SpanNearQuery, to avoid losing any
positive matches, I got to wondering if the span has to be 4 still, or
whether the value increases?
Winding back to talk about the intent of the query, what I would like to do:
- Find the spans for A
- Place some invisible markers 2 positions away from the spans for A
- Within this area "Near A", perform the rest of the boolean span logic
One possible way to rewrite this complicated example might be:
or( within(2, and( a, b, c )),
within(2, and( a, b, d, e )) )
This then falls back to the same rewrite pattern as before, which
suggests that a slop of n*2 (in this case 4) is sufficient to ensure
that no hits are lost.
It also makes me wonder about a feature request for a new kind of span
query. Perhaps it would be called SpanAllNearQuery, taking a span to
use as an anchor and a number of other spans which must also be near
it.
It would be nice if there were a SpanAndQuery and nesting those with
SpanOrQuery in either order could do what you would expect when the
whole thing is inside a SpanNearQuery.
TX
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]