pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Terence Kearns <terencek@isd.canberra.edu.au>
To: pgsql-sql@postgresql.org
Cc: Rajesh Kumar Mallah <mallah@trade-india.com>
Subject: Re: relevance
Date: Thu, 17 Jul 2003 18:39:21 +1000
Message-ID: <3F1660B9.3060801@cts.canberra.edu.au> (raw)
In-Reply-To: <200307171245.44274.mallah@trade-india.com>
References: <001001c34bfd$acad8d50$c733a8c0@slappy>
	<Pine.GSO.4.56.0307170637000.12656@ra.sai.msu.su>
	<3F160F2C.6050902@cts.canberra.edu.au>
	<200307171245.44274.mallah@trade-india.com>

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




view thread (5+ messages)

Message-ID: <3F1660B9.3060801@cts.canberra.edu.au>
Permalink:  ../3F1660B9.3060801@cts.canberra.edu.au/
Also on:    postgresql.org/message-id/3F1660B9.3060801@cts.canberra.edu.au

 · 

reply

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: terencek@isd.canberra.edu.au, mallah@trade-india.com
  Subject: Re: relevance
  In-Reply-To: <3F1660B9.3060801@cts.canberra.edu.au>

* 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