Multi-Column Search
A single full-text index can cover multiple columns. MySQL weights matches in different columns equally by default (title matches carry no automatic extra weight).
A single full-text index can cover multiple columns. MySQL weights matches in different columns equally by default (title matches carry no automatic extra weight).
-- Index both title and body
ALTER TABLE articles ADD FULLTEXT idx_ft (title, body);
-- Search across both columns
SELECT id, title
FROM articles
WHERE MATCH(title, body) AGAINST('performance tuning')
ORDER BY MATCH(title, body) AGAINST('performance tuning') DESC;
To weight title matches higher, use separate indexes and combine scores with arithmetic.