Return to Snippet

Revision: 26404
at April 27, 2010 10:42 by LuckyShot


Initial Code
SELECT *, (
	(1.2 * (MATCH(title) AGAINST (`".$keyword."` IN BOOLEAN MODE))) + 
	(0.8 * (MATCH(description) AGAINST (`+".$keyword."` IN BOOLEAN MODE))) + 
	(1.0 * (MATCH(tags) AGAINST (`".$keyword."` IN BOOLEAN MODE))) 
) AS relevance
FROM `".$table_posts."`
WHERE 
	MATCH (title, description, tags) AGAINST ('".$keyword."' IN BOOLEAN MODE) 
	ORDER BY relevance DESC 
LIMIT 0,5

Initial URL
http://xaviesteve.com/category/web-design/mysql/

Initial Description


Initial Title
MySQL - Most relevant weighted results based (MATCH AGAINST)

Initial Tags
mysql, sql

Initial Language
MySQL