MATCH AGAINST
Use MATCH(columns) AGAINST('query') to search full-text indexes. Returns a relevance score for each row.
Use MATCH(columns) AGAINST('query') to search full-text indexes. Returns a relevance score for each row.
SELECT id, title,
MATCH(title, body) AGAINST('mysql performance') AS score
FROM articles
WHERE MATCH(title, body) AGAINST('mysql performance')
ORDER BY score DESC;
Use MATCH in both SELECT and WHERE for efficiency — MySQL uses the index once.