From: Rajesh Kumar Mallah <mallah@trade-india.com>
To: Tom Rochester <tomr@chu.com.au>
To: pgsql-sql@postgresql.org
Subject: Re: substr_count
Date: Fri, 11 Jul 2003 15:23:16 +0530
Message-ID: <200307111523.16115.mallah@trade-india.com> (raw)
In-Reply-To: <3F0CEDC8.9000304@chu.com.au>
References: <3F0CEDC8.9000304@chu.com.au>
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: mallah@trade-india.com, tomr@chu.com.au
Subject: Re: substr_count
In-Reply-To: <200307111523.16115.mallah@trade-india.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox