Skip to content

Instantly share code, notes, and snippets.

@mhkeller
Created January 23, 2018 16:49
Show Gist options
  • Save mhkeller/0caa25c35102767bcd21c21cf235babb to your computer and use it in GitHub Desktop.
Save mhkeller/0caa25c35102767bcd21c21cf235babb to your computer and use it in GitHub Desktop.
Convert each row in a postgresql table to a text search vector to search across all fields in a table
select *
from table_name
where to_tsvector(table_name::text) @@ to_tsquery('full-text-query');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment