January 2019
Beginner
556 pages
14h 19m
English
The tsquery data type is used to search for a certain lexeme. A lexeme can be combined with the & (AND), | (OR), and ! (NOT) operators. Note that the NOT operator has the highest precedence, followed by AND and then OR. Also, parentheses can be used to group lexemes and operators to force a certain order. The following example shows how we can search for certain lexemes using tsquery, tsvector, and the match operator, @@:
car_portal=# SELECT 'A wise man always has something to say, whereas a fool always needs to say something'::tsvector @@ 'wise'::tsquery; ?column? ---------- t(1 row)
tsquery also has the to_tsquery and plainto_tsquery functions to convert text into lexemes. plainto_tsquery provides a simple interface, ...
Read now
Unlock full access