X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.225.181]) by svr1.postgresql.org (Postfix) with ESMTP id 20154CC757 for ; Thu, 17 Jul 2003 02:37:50 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr5.postgresql.org [64.117.225.181]) (amavisd-new, port 10024) with ESMTP id 58522-04 for ; Thu, 17 Jul 2003 02:38:02 +0000 (GMT) Received: from ra.sai.msu.su (ra.sai.msu.su [158.250.29.2]) by svr1.postgresql.org (Postfix) with ESMTP id 6CDA0CC756 for ; Wed, 16 Jul 2003 23:37:31 -0300 (ADT) Received: from ra (ra [158.250.29.2]) by ra.sai.msu.su (8.9.3/8.9.3) with ESMTP id GAA07803; Thu, 17 Jul 2003 06:37:50 +0400 (MSD) Date: Thu, 17 Jul 2003 06:37:49 +0400 (MSD) From: Oleg Bartunov X-X-Sender: megera@ra.sai.msu.su To: jtx Cc: pgsql-sql@postgresql.org Subject: Re: relevance In-Reply-To: <001001c34bfd$acad8d50$c733a8c0@slappy> Message-ID: References: <001001c34bfd$acad8d50$c733a8c0@slappy> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/208 X-Sequence-Number: 14322 Have you seen contrib/tsearch ? http://www.sai.msu.su/~megera/postgres/gist/tsearch/ Oleg On Wed, 16 Jul 2003, jtx wrote: > I'm trying to build a really basic search engine for a site I'm using - > say I'm going to simplify this as much as I can. > > Say I have a table with 2 columns: id, message > > Person wants to search for the term 'sql'. So, I'd do a simple search > like: > > 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? > > Thanks! > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly > Regards, Oleg _____________________________________________________________ Oleg Bartunov, sci.researcher, hostmaster of AstroNet, Sternberg Astronomical Institute, Moscow University (Russia) Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/ phone: +007(095)939-16-83, +007(095)939-23-83