Views filters - Contains, Contains Word, Contains Any.

When you create an exposed filter for a text field, you can choose the operator from a list. This determines how the keywords entered by the user are used in the filter query.

Views text filter operator

I was confused by "Contains" vs "Contains any word" and "Contains all words".

Until I found this post by @merlinofchaos:
https://www.drupal.org/project/views/issues/1744880#comment-6383628

Assuming the filter value is 'foo bar baz'

 

Contains produces a query like this:
table.field LIKE ('%foo bar baz%');

Contains any word produces a query like this:
(table.field LIKE ('% foo %') OR table.field LIKE ('% bar %') OR table.field LIKE ('% baz %'))

Tags
Views