LIKE '%keyword%' breaks down on large text data. MySQL's full-text search indexes words themselves, enabling fast keyword search with relevance scoring — no external search engine needed for many use cases.
Key Points
- Create: ALTER TABLE articles ADD FULLTEXT(title, body);
- Search: SELECT * FROM articles WHERE MATCH(title, body) AGAINST('mysql indexing');
- Natural language mode ranks results by relevance automatically
- Boolean mode: AGAINST('+mysql -oracle' IN BOOLEAN MODE) for must/must-not terms
- Words shorter than innodb_ft_min_token_size (default 3) are ignored
- For advanced needs (typos, facets), consider Elasticsearch alongside MySQL
.png)