From: | Terence Kearns <terencek(at)isd(dot)canberra(dot)edu(dot)au> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Cc: | Rajesh Kumar Mallah <mallah(at)trade-india(dot)com> |
Subject: | Re: relevance |
Date: | 2003-07-17 08:39:21 |
Message-ID: | 3F1660B9.3060801@cts.canberra.edu.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Rajesh Kumar Mallah wrote:
>
>
> On Thursday 17 Jul 2003 8:21 am, Terence Kearns wrote:
>
>>>>select id from tablename where message like '%sql%';
>>>>
>>>>If there any way to determine exactly how many times 'sql' is matched in
>>>>that search in each particular row, and then sort by the most matches,
>>>>or am I going to have to write a script to do the sorting for me?
>>
>>You could probably write a function in postgres (say, "matchcount()")
>>which returns the match count (possibly using perl and a regex).
>
>
>
> Why reinvent the wheel when tsearch already does the job perfectly
> and is PostgreSQL compaitable.
>
Tsearch2 looks like it would be very useful but it's a lot of work to
implement IMHO. At least it will probably (assumption) be a lot more
efficient for massive amounts of data.
Remember the original question was regarding how to list results in
order of how many hits were returned for each matched record.
--
Terence Kearns ~ ph: +61 2 6201 5516
IT Database/Applications Developer
Enterprise Information Systems
Client Services Division
University of Canberra
www.canberra.edu.au
From | Date | Subject | |
---|---|---|---|
Next Message | Terence Kearns | 2003-07-17 10:46:53 | parse error for function def |
Previous Message | Rajesh Kumar Mallah | 2003-07-17 07:15:44 | Re: relevance |