3 ms·
It's only offhandedly mentioned at the bottom of the post, but the websearch_to_tsquery() function added in PostgreSQL 11 is extremely useful and lets you creat
by Deimorz 7y ago
It's only offhandedly mentioned at the bottom of the post, but the websearch_to_tsquery() function added in PostgreSQL 11 is extremely useful and lets you create a pretty decent search system immediately without having to implement any sort of query-parsing yourself.
It supports searching for alternatives with "or", phrases in quotes, and excluding terms with a minus sign, which is all syntax that a lot of people are already used to. For example it can handle a query like:
blizzard or overwatch -"hong kong"
That would find anything with "blizzard" or "overwatch" in it, but exclude anything with "hong kong" (if you wanted to avoid results about that recent controversy).
It's a great addition, and made it even easier to implement reasonable search functionality with PostgreSQL.