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.

CommentFileSizeAuthor
#1 2127991-1--negated_and_keys.patch856 bytesdrunken monkey

Comments

drunken monkey’s picture

Status: Active » Needs review
StatusFileSize
new856 bytes

The attached patch changes the output to the correct -(A AND B AND C) for this case.
Please test/review!

drunken monkey’s picture

Added 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.

drunken monkey’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.