Re: [SQL] relevance

2003-07-17 Thread Terence Kearns
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

Re: [SQL] relevance

2003-07-17 Thread Rajesh Kumar Mallah
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 t

Re: [SQL] relevance

2003-07-16 Thread Terence Kearns
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 functio

Re: [SQL] relevance

2003-07-16 Thread Oleg Bartunov
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, messag

[SQL] relevance

2003-07-16 Thread jtx
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%'