Tuning Relevance
Boost relevance for title matches by weighting scores manually. You cannot configure TF-IDF weights directly, but you can combine scores arithmetically.
Boost relevance for title matches by weighting scores manually. You cannot configure TF-IDF weights directly, but you can combine scores arithmetically.
SELECT id, title,
(MATCH(title) AGAINST('mysql') * 3 +
MATCH(body) AGAINST('mysql')) AS weighted_score
FROM articles
WHERE MATCH(title, body) AGAINST('mysql')
ORDER BY weighted_score DESC;
Use separate single-column indexes if you want to weight columns differently.