Skip to content

Instantly share code, notes, and snippets.

@foxcarlos
Created December 13, 2019 18:37
Show Gist options
  • Save foxcarlos/90a54cefb40767e07e3b3ad9f8d27e15 to your computer and use it in GitHub Desktop.
Save foxcarlos/90a54cefb40767e07e3b3ad9f8d27e15 to your computer and use it in GitHub Desktop.
select * from public.directory_telephone where to_tsvector(name) @@ to_tsquery('morosini & paloma') union
select * from public.directory_telephone where to_tsvector(name) @@ to_tsquery('morosini <-> paloma') union
select * from public.directory_telephone where to_tsvector(street) @@ to_tsquery('morosini & paloma') union
select * from public.directory_telephone where to_tsvector(street) @@ to_tsquery('morosini <-> paloma') union
select * from public.directory_telephone where to_tsvector(phone) @@ to_tsquery('morosini & paloma') union
select * from public.directory_telephone where to_tsvector(phone) @@ to_tsquery('morosini <-> paloma') union
select * from public.directory_telephone where to_tsvector(name) @@ to_tsquery('morosini | paloma') union
select * from public.directory_telephone where to_tsvector(street) @@ to_tsquery('morosini | paloma') union
select * from public.directory_telephone where to_tsvector(phone) @@ to_tsquery('morosini | paloma')
dt._prepare_str_sql('morosini paloma', 'name', '&')
dt._prepare_str_sql('morosini paloma', 'name', '<->')
dt._prepare_str_sql('morosini paloma', 'street', '&')
dt._prepare_str_sql('morosini paloma', 'street', '<->')
dt._prepare_str_sql('morosini paloma', 'phone', '&')
dt._prepare_str_sql('morosini paloma', 'phone', '<->')
dt._prepare_str_sql('morosini paloma', 'name', '|')
dt._prepare_str_sql('morosini paloma', 'street', '|')
dt._prepare_str_sql('morosini paloma', 'phone', '|')
# --------------------------------------------------------------------------------------------
select * from public.directory_telephone where to_tsvector(name) @@ to_tsquery('morosini & paloma') union
select * from public.directory_telephone where to_tsvector(name) @@ to_tsquery('morosini <-> paloma') union
select * from public.directory_telephone where to_tsvector(street) @@ to_tsquery('morosini & paloma') union
select * from public.directory_telephone where to_tsvector(street) @@ to_tsquery('morosini <-> paloma') union
select * from public.directory_telephone where to_tsvector(phone) @@ to_tsquery('morosini & paloma') union
select * from public.directory_telephone where to_tsvector(phone) @@ to_tsquery('morosini <-> paloma') union
select * from public.directory_telephone where to_tsvector(name) @@ to_tsquery('morosini | paloma') union
select * from public.directory_telephone where to_tsvector(street) @@ to_tsquery('morosini | paloma') union
select * from public.directory_telephone where to_tsvector(phone) @@ to_tsquery('morosini | paloma')
def sql_str(text, fig):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment