TO_TSQUERY
Builds a full-text search query: words with “and”, “or” and “not” conditions.
Syntax
TO_TSQUERY('<language config>', '<query>')
WEBSEARCH_TO_TSQUERY('<language config>', <search box text>)
In a query, words are joined with operators: & — “and”, | — “or”, ! — “not”, <-> — “one right after the other”. Words are reduced to stems the same way as in TO_TSVECTOR. WEBSEARCH_TO_TSQUERY accepts ordinary search box text — words, quotes and minus signs — and turns it into a query by itself.