Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Listing results by number of matches(conditions satisfied)

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-10-22 : 23:52:09
Drazen writes "Hi,

I would like to ask you about a little thing that I am wondering about...
I've been working on a little SQL database, and my problem is :

Let's say you have a database of term papers or articles or anything of that sort.
And it contains keywords from each of those papers/articles.
And you try to make a search.

For example you enter the search words SQL Perl CGI.
And it finds all the papers where either words SQL or Perl
or CGI appear.
That much I already have. It works.

BUT - how to make it list the articles with more matches first?
Right now it will list article where only word "Perl" appears
before the article where all the required terms - "SQL", "Perl"
and "CGI" appear.
Basically I don't know how to tell the database to order the
list by the number of the matching
words found(number of conditions satisfied).
I can use "ORDER BY" date or something, but not by the
number of matches found...

Any ideas, suggestions or experiences on how to do
it with SQL alone or Perl + SQL (no asp or php)?

Thanks in advance,

~Drazen"
   

- Advertisement -