As documented in the code, we currently handle the settings in fulltext keys arrays like this:
#conjunction | #negation | return value
----------------------------------------------------------------
AND | FALSE | A B C
AND | TRUE | -(A B C)
OR | FALSE | ((A) OR (B) OR (C))
OR | TRUE | -A -B -C
However, I now found out that the queries for both negated cases (-(A B C) and -A -B -C) are actually equivalent, doing what I'd suppose of the latter. It seems that in a negated sub-expression Solr automatically switches the default operator – rather clever, but in this case not what we want.
Comments
Comment #1
drunken monkeyThe attached patch changes the output to the correct
-(A AND B AND C)for this case.Please test/review!
Comment #2
drunken monkeyAdded related issue #2128001: Fix logic for "contains none of these words" fulltext operator which should be committed before this one, since the bug here is actually covering up the other one.
Comment #3
drunken monkeyCommitted.