Re: substr_count

From: Rajesh Kumar Mallah <mallah(at)trade-india(dot)com>
To: Tom Rochester <tomr(at)chu(dot)com(dot)au>, pgsql-sql(at)postgresql(dot)org
Subject: Re: substr_count
Date: 2003-07-11 09:53:16
Message-ID: 200307111523.16115.mallah@trade-india.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thursday 10 Jul 2003 10:08 am, Tom Rochester wrote:
> Hey all,
>
> I would like to achive something along the lines of:
>
> SELECT field FROM table WHERE field ILIKE '$searchterm' ORDER BY
> substr_count(field, '$searchterm');
>

Hi In case you are attempting to search text in a feild
and sort it by relevence then contrib/tsearch V2 is
for you.

http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/

regds
mallah.

> Of course the substr_count function does not exist. Is there anyway to
> do this?
>
> I had a thought char_count(replace(field, !$searchterm, '')) might do
> the job but replace doesn't allow for 'replace everything NOT string';
>
> Any Ideas?
>
> Thanks in advance,

--
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2003-07-12 04:03:31 Re: Problem with temporary table -- Urgent
Previous Message Michael A Nachbaur 2003-07-10 20:00:43 Re: help yourself by helping others