Why Not LIKE?
LIKE '%word%' cannot use a normal index and has no idea about words or relevance. A FULLTEXT index splits text into words, so MySQL can find rows by word quickly and rank them.
Create a FULLTEXT Index
Result:
| id | title |
|---|---|
| 1 | Learning MySQL |
| 2 | Indexes explained |
Natural Language Mode and Relevance
The default mode ranks rows. MATCH returns a relevance score you can select and sort by:
Result:
| id | title |
|---|---|
| 1 | Learning MySQL |
| 4 | MySQL replication |
| 2 | Indexes explained |
Row 1 contains both words, so it ranks first. Rows 2 and 4 contain one word each. Row 3 has neither and is not returned. The exact score is a decimal number that depends on the index statistics, so rely on the ordering rather than on the score value (you can select it with MATCH(...) AGAINST(...) AS score).
Boolean Mode
| Operator | Meaning | Example |
|---|---|---|
+ | Word must be present | +mysql |
- | Word must be absent | -replication |
* | Prefix wildcard | repl* |
"..." | Exact phrase | "relational database" |
> < | Raise or lower the rank of a word | >fast |
Result:
| id | title |
|---|---|
| 1 | Learning MySQL |
Result:
| id | title |
|---|---|
| 2 | Indexes explained |
| 4 | MySQL replication |
Result:
| id | title |
|---|---|
| 1 | Learning MySQL |
Stopwords and Short Words
Very common words ("the", "is", "and") are stopwords and are not indexed. InnoDB also ignores words shorter than innodb_ft_min_token_size (3 characters by default). So a search for a two-letter word finds nothing:
Result:
(0 rows)
Result:
| min_word_length | myisam_min_word_len |
|---|---|
| 3 | 4 |
The setting is read at server start, so you change it in my.cnf, restart, and rebuild the index (OPTIMIZE TABLE or drop and recreate).
50% Rule and Small Tables
In natural language mode, a word that is in more than half of the rows is treated as too common and ignored. This surprises people who test with tiny tables where every row contains the word. Boolean mode does not have this rule.
Relevance Beats LIKE, But Know the Limits
- Matches whole words (and prefixes with
*), not arbitrary substrings. - Languages without spaces (Chinese, Japanese) need the
ngramparser:FULLTEXT (body) WITH PARSER ngram. - No fuzzy matching or typo tolerance. Large search products (OpenSearch, Elasticsearch, Meilisearch) add that.
- Inserts into large indexed tables are a little slower.
Common Beginner Mistakes
| Mistake | What happens | Fix |
|---|---|---|
MATCH columns differ from the index columns | Error 1191 | List exactly the indexed columns |
| Testing on 3 rows in natural mode | No results (50% rule) | Use more data or boolean mode |
| Searching words shorter than 3 characters | No hits | Change the token size or use LIKE |
| Expecting substring matches | Missing results | Use prefix *, or ngram |
| Searching an ENGINE=MyISAM table in new designs | Older engine, no transactions | Use InnoDB |
Practice
- Create a FULLTEXT index on
titleandbodyand search for a word. - Rank results with
MATCH ... AGAINSTin theORDER BY. - Use boolean mode to find posts with
+mysqlbut-replication. - Check the minimum token size on your server.
Conclusion
A FULLTEXT index lets MATCH ... AGAINST search by word with ranking. Use boolean mode operators for control, remember stopwords, short words and the 50% rule, and move to a search engine when you need fuzzy matching.

