A
Anonymous
Guest
Code:
SELECT *, MATCH(features) AGAINST('15 11' IN BOOLEAN MODE) as relevance FROM products
WHERE
MATCH(features) AGAINST('15 11' IN BOOLEAN MODE)
AND (price1 <= 9999 OR (saleprice <= 9999 AND sale_expiry > UNIX_TIMESTAMP()))
AND (price1 >= 0 OR (saleprice >= 0 AND sale_expiry > UNIX_TIMESTAMP()))
I am trying this query to find a product with the features 15 and 11. The way I expect this query to work it would be returning results.
The features field containts a string of all the features for a specific product (e.g. '12 15' for MP3 and Camera).
There IS a fulltext index with the features and when the MATCH AGAINST part of the query is taken out there are plenty of results returned, so the problem is completely in the match against I assume.
I have done something like this before and it worked just right and relevance was returned with a score of how many features were found. For instance if the search string had 4 features in it, and a certain product had 3 of those, it would return "3" as relevance, just like it should.