Re: tsearch partial word - Mailing list pgsql-general

From Hannes Dorbath
Subject Re: tsearch partial word
Date
Msg-id 4444908D.6050706@theendofthetunnel.de
Whole thread Raw
In response to tsearch partial word  ("Yudie Pg" <yudiepg@gmail.com>)
List pgsql-general
On 17.04.2006 21:48, Yudie Pg wrote:
> Is it possible to search partial word as *like '%...%'* in tsearch?

You can create a table with all the unique lexems (see pg_trgm doc on
how to do that) use LIKE %<whatever>% on it, join the matching lexems
with | in your ts_query..

It works ok as long as the count of returned lexems is low.. at some
point a seq scan would be faster again, so you might want to add a
threshold to fall back to that..


--
Regards,
Hannes Dorbath

pgsql-general by date:

Previous
From: Kris Jurka
Date:
Subject: Re: Postgresql and Creator2 commitChanges()
Next
From: "P.MO"
Date:
Subject: select with date_part and month failure....