May 2017
Beginner
416 pages
10h 37m
English
One of the most promising new features of PostgreSQL is the ability to perform phrase searching. Up to 9.5 it was only possible to search for words—phrase searching was very hard to do. 9.6 nicely removes this limitation. Here is an example of how it works:
test=# SELECT phraseto_tsquery('Under pressure') @@ to_tsvector('Something was under some sort of pressure');?column?----------f(1 row)test=# SELECT phraseto_tsquery('Under pressure') @@ to_tsvector('Under pressure by David Bowie hit number 1 again');?column?----------t(1 row)
The first query returns false because the words we are looking for do not occur in the desired order. In the second example, true is returned because there really ...
Read now
Unlock full access