Actually it was a mistake in NEST
A predecessor of how NEST helps translate logical queries:
NEST allows you to use operator overloading to create detailed bool queries / filters. i. ru:
term && term will result in:
bool must term term
A naive implementation of this will rewrite
term && term && term to
bool must term bool must term term
As you can imagine, this gets cumbersome pretty quickly, a more complex request becomes NEST, which can identify them and combine them to become
bool must term term term
Similarly, term && term && term && !term just becomes:
bool must term term term must_not term
now if in the previous example you go into booleanquery right like this:
bool(must=term, term, term) && !term
it will still generate the same request. NEST will also do the same with should when it sees that the logical descriptors in the game ONLY consist of should clauses . This is because boolquery does not exactly match the logic that you expect from a programming language.
To summarize the latter:
term || term || term
becomes
bool should term term term
but
term1 && (term2 || term3 || term4) will NOT
bool must term1 should term2 term3 term4
This is due to the fact that, as soon as a logical request has a prerequisite, it should begin to act as a factor of increase. Thus, in the previous case, you could get results that ONLY contain term1 , this is clearly not what you want in the strict logical sense of the input.
NEST rewrites this request to
bool must term1 bool should term2 term3 term4
Now that the error has entered the game, it was that you have your situation
bool(should=term1, term2, minimum_should_match=2) || term3 bool(should=term1, term2, minimum_should_match=2) || term3 NEST, identified by both sides of the OR operation, contains only meaningful sentences, and it combines them together, which would give different meaning to the minimum_should_match parameter of the first boolean request.
I just clicked the fix for this and it will be fixed in the next version 0.11.8.0
Thanks for catching this one!