Awesome, 0 pre and 1 post works!
I replaced pre with Integer.MAX_VALUE and post with Integer.MAX_VALUE - 5
and it works!

If I replace post with Integer.MAX_VALUE - 4 (or -3, -2, -1, -0), it fails.
But, if it's -(5+), it appears to work.

Thank you guys for suffering through my inexperience with Solr.



*NOTE*: In case someone would find it helpful to follow my reasoning before
I discovered the work-around above:

I don't understand why 0,1 works and Integer.MAX_VALUE, Integer.MAX_VALUE
doesn't.  I mean I know that six and seven both come one word after thirty *in
this case*.  This is case-dependent.  What if I wanted to match thirty, but
exclude if six or seven are included anywhere in the document?

How will I know what numbers to plug into pre and post when they could be
anywhere in the document?

In this case, those numbers worked.  Why didn't the big numbers work?
After all, six and seven were unique throughout the whole number (i.e. six
and seven were only at the end of the document).

I also tried 0 pre and 0 post, but that gave me the same as I had when I
had pre and post as really large numbers.



On Tue, Jun 21, 2016 at 12:50 PM, Allison, Timothy B. <talli...@mitre.org>
wrote:

> >Perhaps I'm misunderstanding the pre/post parameters?
>
> Pre/post parameters: " 'six' or 'seven' should not appear $pre tokens
> before 'thirty' or $post tokens after 'thirty'
>
> Maybe something like this:
> spanNear([
>   spanNear([field:one, field:thousand, field:one, field:hundred], 0, true),
>   spanNot(field:thirty, spanOr([field:six, field:seven]), 0,
> 1)
>   ], 0, true)
>
>

Reply via email to