Re: tsearch2 - Mailing list pgsql-general

From John DeSoi
Subject Re: tsearch2
Date
Msg-id 2C238342-A122-4617-A2E4-E1887E71D776@pgedit.com
Whole thread Raw
In response to tsearch2  ("Chris Hoover" <revoohc@gmail.com>)
List pgsql-general
On Jun 14, 2006, at 6:29 PM, Chris Hoover wrote:

> How do you set it up to search for "how now brown cow" vs how now
> brown cow?  The first example is looking for the exact phrase of
> words, while the second is just looking for all of the works.

Your select would have two conditions, one to find rows with the
words using the tsearch2 index and then a filtering condition (e.g.
AND like '%how now brown cow%'). How effective this is depends a lot
on your data, but it works well as long as the indexed search can
return a reasonably small set for the sequential scan on the
filtering condition.

There is an example in the documentation if you need more details.


John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


pgsql-general by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: table has many to many relationship with itself - how to implement?
Next
From: "Yavuz Kavus"
Date:
Subject: how to test my stored procedures?