Page 1 of 1

fulltext search relevancy does not work

Posted: Wed Jul 13, 2005 2:39 pm
by knford
I'm trying to get the relevancy to return from this fulltext search, but it returns zero every time. The results appear and there are not any errors. I used phpmyadmin and setup and fulltext on the column "short_desc" using an alter statement. I am using the newest version of xammp, which uses Apache/2.0.53 (Win32) and PHP version 5.0.4. Here is the code, which I've reduced to the basics:

SELECT title, short_desc, MATCH(short_desc) AGAINST(\"$search\") AS score
FROM listings

Any help finding the solution so the relevancy is returned would be appreciated. thank you.

Posted: Wed Jul 13, 2005 2:43 pm
by timvw
you are missing the WHERE clause in your query...

Posted: Wed Jul 13, 2005 3:05 pm
by onion2k
You should also be aware that certain words won't be searched by default, you have to alter the stopword list.. there's a list of the default word list here: http://dev.mysql.com/tech-resources/art ... ealed.html

Why that's not in the manual is beyond me. Plus, I'm sure there's some missing from that list. If I try to search for "search" it never returns proper results for me. (Might well be my code mind you).

Solved!

Posted: Thu Jul 21, 2005 12:05 pm
by knford
There were too few records in the table for the fulltext to compare and assign a relevancy value. You need at least a dozen records.