Re: [GENERAL] ts_tovector() to_query()

2013-03-29 Thread Severn, Chris
ssage- From: dep...@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

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 to_tsvector(m.

Re: [GENERAL] ts_tovector() to_query()

2013-03-28 Thread Sergey Konoplev
On Thu, Mar 28, 2013 at 2:12 PM, Kevin Grittner 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) @@ to_tsquery('Robocop & (DVD

Re: [GENERAL] ts_tovector() to_query()

2013-03-28 Thread Kevin Grittner
"Severn, Chris" 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. > > What I want t

[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' or