SyntaxStudy
Sign Up
MySQL MATCH ... AGAINST Syntax
MySQL Beginner 3 min read

MATCH ... AGAINST Syntax

MATCH AGAINST

Use MATCH(columns) AGAINST('query') to search full-text indexes. Returns a relevance score for each row.

Example
SELECT id, title,
       MATCH(title, body) AGAINST('mysql performance') AS score
FROM articles
WHERE MATCH(title, body) AGAINST('mysql performance')
ORDER BY score DESC;
Pro Tip

Use MATCH in both SELECT and WHERE for efficiency — MySQL uses the index once.