Skip to content

Instantly share code, notes, and snippets.

@foxcarlos
Created December 9, 2019 19:10
Show Gist options
  • Save foxcarlos/911ad676bf3b288ed710345ac1b8820a to your computer and use it in GitHub Desktop.
Save foxcarlos/911ad676bf3b288ed710345ac1b8820a to your computer and use it in GitHub Desktop.
SQL Full Text Search PostgreSQL
sql = "select * from directory_telephone where to_tsvector(name) @@ to_tsquery('farmacia | norte');"
self._cr.execute(sql)
self._cr.fetchall()
# select * from public.directory_telephone where to_tsvector(name) @@ to_tsquery('farmacia | norte');
# select * from public.directory_telephone where to_tsvector(name) @@ to_tsquery('farmacia & norte');
# select * from public.directory_telephone where to_tsvector(street) @@ to_tsquery('farmacia | norte');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment