Re: [GENERAL] ts_tovector() to_query()

2013-03-29 Thread hubert depesz lubaczewski
On Thu, Mar 28, 2013 at 08:50:50PM +, Severn, Chris wrote: What I want to do is return items that have 'Robocop' or 'Robocop and DVD' or 'Robocop and Collection' or 'Robocop and DVD and collection' Based on the criteria above, I would say that: SELECT m.* FROM movies m WHERE

Re: [GENERAL] ts_tovector() to_query()

2013-03-29 Thread Severn, Chris
...@depesz.com [mailto:dep...@depesz.com] Sent: Friday, March 29, 2013 7:59 AM To: Severn, Chris Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] ts_tovector() to_query() On Thu, Mar 28, 2013 at 08:50:50PM +, Severn, Chris wrote: What I want to do is return items that have 'Robocop

[GENERAL] ts_tovector() to_query()

2013-03-28 Thread Severn, Chris
I have a statement that is like this SELECT m.* FROM movies m WHERE to_tsvector(m.item_title) @@ to_tsquery('Robocop|DVD|Collection') this works, but it correctly returns all the matching records that have any of the query items in them. What I want to do is return items that have 'Robocop'

Re: [GENERAL] ts_tovector() to_query()

2013-03-28 Thread Kevin Grittner
Severn, Chris chris_sev...@chernay.com wrote: I have a statement that is like this SELECT m.* FROM movies m    WHERE to_tsvector(m.item_title) @@ to_tsquery('Robocop|DVD|Collection') this works, but it correctly returns all the matching records that have any of the query items in them.

Re: [GENERAL] ts_tovector() to_query()

2013-03-28 Thread Sergey Konoplev
On Thu, Mar 28, 2013 at 2:12 PM, Kevin Grittner kgri...@ymail.com wrote: What I want to do is return items that have 'Robocop' or 'Robocop and DVD' or 'Robocop and Collection' or 'Robocop and DVD and collection' SELECT m.* FROM movies m WHERE to_tsvector(m.item_title) @@