Re: tsearch partial word

From: Hannes Dorbath <light(at)theendofthetunnel(dot)de>
To: Yudie Pg <yudiepg(at)gmail(dot)com>
Subject: Re: tsearch partial word
Date: 2006-04-18 07:09:01
Message-ID: 4444908D.6050706@theendofthetunnel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message P.MO 2006-04-18 07:20:50 select with date_part and month failure....
Previous Message Mavinakuli, Prasanna (STSD) 2006-04-18 07:01:57 Re: HUGE Stack space is gettiing consumed