contains_tokens(column, tokens) is true when column contains all the
tokens in tokens, split on whitespace and punctuation. It is equivalent to
an fts() match query with fuzziness off, AND semantics
and the simple tokenizer — reach for it when you need a keyword test in a
WHERE clause and have no use for a relevance score.
Index-accelerated. When the column has a full-text index that suits the
query, the planner uses it instead of scanning, which is the reason to prefer
it over LIKE or contains for keyword tests. See
EXPLAIN to confirm the plan uses the index.
What to read next
Full-Text Search
The
fts() table function, for relevance-ranked results and fuzzy,
phrase, boolean, boost and multi-match queries.FTS Index
Build the full-text index this predicate accelerates against.