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:
View on Drupal.org #1744880Any documentation explaining different views filter operators? Contains Vs. Contains any word Status: Closed (fixed)

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