Hi everyone;
I've recently discovered a mistake in the source code of products.php. The SQL to select related products contains ORDER BY relevance; but it should be ORDER BY relevance DESC. This is because the higher the relevance value the more relevant the product; so it was actually selecting the least relevant products that match the main product for a full text search...
To correct this, look for the following code around line 75 of products.php
$sql = "SELECT * , MIN( price ) AS minPrice, MAX( price ) AS maxPrice, COUNT( id ) AS numMerchants, MATCH name AGAINST ('".database_safe($q)."') AS relevance FROM `".$config_databaseTablePrefix."products` WHERE ".$where." GROUP BY name ORDER BY relevance LIMIT 3";
...and replace this with:
$sql = "SELECT * , MIN( price ) AS minPrice, MAX( price ) AS maxPrice, COUNT( id ) AS numMerchants, MATCH name AGAINST ('".database_safe($q)."') AS relevance FROM `".$config_databaseTablePrefix."products` WHERE ".$where." GROUP BY name ORDER BY relevance DESC LIMIT 3";
This has been fixed in the latest distribution.
Cheers,
David.
Thanks David,
I was just looking at these, thinking, geesh, that isn't related :-)