Search Postgresql Archives

Re: tsearch2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux