If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > MySQL full text search, return results in order of relevancy

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-20-04, 11:02
ukfp ukfp is offline
Registered User
 
Join Date: Mar 2004
Posts: 3
MySQL full text search, return results in order of relevancy

Hi,

I'm trying to setup a search engine with the aid of PHP and MySQL. The problem is returning the results in order of the highest relevancy when IN BOOLEAN MODE.

Here is my first query; this query is without the Boolean mode, and DOES order by relevancy:

Quote:
SELECT id,
MATCH (title, body, location, cost)
AGAINST ('html') AS relevance
FROM courses
WHERE MATCH (title, body, location, cost)
AGAINST ('html');
However, this search engine must have Boolean facilities. So I constructed this query:

Quote:
SELECT id,
MATCH (title, body, location, cost)
AGAINST ('html' IN BOOLEAN MODE) AS relevance
FROM courses
WHERE MATCH (title, body, location, cost)
AGAINST ('html' IN BOOLEAN MODE);
However this returns records what contain the query in order of input to the database, e.g. rec 1 comes before rec 2 even if rec 2 is more relevant!

Here is an image to make it clearer:

http://www.xmlmania.com/tmp/db-screeny.gif

Thanks in advance!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On