mameha1977
01-24-2008, 03:03 AM
In MySQL I have a query using MATCH and SCORE.
There is one problem. When I use quotes in the query, it doesnt affect the results at all. Is there some problem with MATCH so that it ignores quotes?
This is my query. I get the same 30 results whether I use quotes or not, even though "big red product" should rank higher than "red man toy product".
SELECT *,
(MATCH (title) AGAINST ('\"red product\"' IN BOOLEAN MODE)*6)
+
(MATCH (documentCode, filename) AGAINST ('\"red product\"' IN BOOLEAN MODE)*6)
+
(MATCH (title_highlight, product_type, headline) AGAINST ('\"red product\"' IN BOOLEAN MODE)*3)
AS score
FROM documents
WHERE status = 'ACT' AND
MATCH(title, title_highlight, headline, product_type, documentCode, filename) AGAINST ('\"red product\"' IN BOOLEAN MODE)
ORDER BY score DESC;
There is one problem. When I use quotes in the query, it doesnt affect the results at all. Is there some problem with MATCH so that it ignores quotes?
This is my query. I get the same 30 results whether I use quotes or not, even though "big red product" should rank higher than "red man toy product".
SELECT *,
(MATCH (title) AGAINST ('\"red product\"' IN BOOLEAN MODE)*6)
+
(MATCH (documentCode, filename) AGAINST ('\"red product\"' IN BOOLEAN MODE)*6)
+
(MATCH (title_highlight, product_type, headline) AGAINST ('\"red product\"' IN BOOLEAN MODE)*3)
AS score
FROM documents
WHERE status = 'ACT' AND
MATCH(title, title_highlight, headline, product_type, documentCode, filename) AGAINST ('\"red product\"' IN BOOLEAN MODE)
ORDER BY score DESC;