Currently, when the operator for the "Search: Fulltext search" filter is set to "contains none of these words", we create a query with #negation set and with the conjunction AND. However, that actually means we get "contains not all of these words", as the resulting keys array will be interpreted as NOT (A AND B) (not (NOT A) AND (NOT B)). We should therefore switch the conjunction we use internally to OR for that case.

This couldn't really be noticed on the database backend before, since completely negated keys don't work at all there – see #2127001: The fulltext operator "contains none of these words" is not working.

Why wasn't this noticed on Solr before, you ask? Good question! Turns out the code for negated keys in Solr was buggy all along, too, treating AND and OR essentially the same: see #2127991: Fix handling of negated fulltext keys. Therefore, there were two bugs that neatly cancelled each other out. Nice, right? Unless someone updates the Solr module before this one, things should keep working as before with both these issues committed.

Comments

drunken monkey’s picture

Status: Active » Needs review
StatusFileSize
new836 bytes

Patch attached.

gilsbert’s picture

patch #1 is working perfectly.

gilsbert’s picture

Hi.
I retested the patch #1 over the last dev version (7.x-1.9+14-dev of november 13th 2013) and it is working.
Regards,
Gilsberty

gilsbert’s picture

Status: Needs review » Reviewed & tested by the community
drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Thanks a lot for testing, good to hear it (still) works!
Committed.

Status: Fixed » Closed (fixed)

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