to_tsquery()

A function for converting text to a tsquery

to_tsquery() is a system function for converting text to a tsquery.

to_tsquery() was added in PostgreSQL 8.3.

Usage

to_tsquery ( [ config regconfig, ] query text ) → tsquery

to_tsquery() converts a sring to the tsquery type. The words in the provided string must be combined by valid tsquery operators.

A text search configuration can be specified

Change history

Examples

Basic usage example for to_tsquery():

postgres=# SELECT to_tsquery('Fat:ab & Cats');
    to_tsquery    
------------------
 'fat':AB & 'cat'
(1 row)

Categories

Full Text Search, System function

See also

plainto_tsquery(), phraseto_tsquery(), websearch_to_tsquery()