[
https://issues.apache.org/jira/browse/LUCENE-7431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15641157#comment-15641157
]
David Smiley commented on LUCENE-7431:
--------------------------------------
Patch looks pretty good; thanks.
I was confused a little on the semantics but after a little experimentation, I
get it. The "negative values" assert messages were sometimes inconsistent with
the parameters, so I tweaked that, and I added a test line to help me
understand something.
final lines at end of testSpanNots:
{code}
assertEquals("SpanNotS2S1NotXXNeg_0_0", 1, spanCount("s2 s1", 10, "xx", 0,
0));
assertEquals("SpanNotS2S1NotXXNeg_1_1", 1, spanCount("s2 s1", 10, "xx", -1,
-1));
assertEquals("SpanNotS2S1NotXXNeg_0_2", 2, spanCount("s2 s1", 10, "xx", 0,
-2));
assertEquals("SpanNotS2S1NotXXNeg_1_2", 2, spanCount("s2 s1", 10, "xx", -1,
-2));
assertEquals("SpanNotS2S1NotXXNeg_2_1", 2, spanCount("s2 s1", 10, "xx", -2,
-1));
assertEquals("SpanNotS2S1NotXXNeg_3_1", 2, spanCount("s2 s1", 10, "xx", -3,
-1));
assertEquals("SpanNotS2S1NotXXNeg_1_3", 2, spanCount("s2 s1", 10, "xx", -1,
-3));
assertEquals("SpanNotS2S1NotXXNeg_2_2", 3, spanCount("s2 s1", 10, "xx", -2,
-2));
{code}
I'll commit the patch with this tweak early this coming week.
> Allow negative pre/post values in SpanNotQuery
> ----------------------------------------------
>
> Key: LUCENE-7431
> URL: https://issues.apache.org/jira/browse/LUCENE-7431
> Project: Lucene - Core
> Issue Type: Improvement
> Components: core/search
> Reporter: Marc Morissette
> Priority: Minor
> Attachments: LUCENE-7431.patch
>
>
> I need to be able to specify a certain range of allowed overlap between the
> include and exclude parameters of SpanNotQuery.
> Since this behaviour is the inverse of the behaviour implemented by the pre
> and post constructor arguments, I suggest that this be implemented with
> negative pre and post values.
> Patch incoming.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]