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:

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:

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!