SELECT *, MATCH(name,surname,alternatenames) AGAINST('+napo*' IN BOOLEAN MODE)
FROM names
WHERE MATCH(name,surname,alternatenames) AGAINST ('+napo*' IN BOOLEAN MODE)
and (class='P'
OR code='m'
OR code='PC'
OR code='PCL')
order by population DESC
LIMIT 0,10
SELECT *, MATCH(name,surname,alternatenames) AGAINST('+don +chi*' IN BOOLEAN MODE)
FROM names
WHERE MATCH(name,surname,alternatenames) AGAINST ('+don +chi*' IN BOOLEAN MODE)
and (class='P'
OR code='m'
OR code='PC'
OR code='PCL')
order by population DESC
LIMIT 0,10
You probably have the default value for...
mysql> SHOW VARIABLES LIKE 'ft_min%';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| ft_min_word_len | 4 |
+-----------------+-------+
Read the online documentation for why that matters, how to change it, etc.
Suggest this change (unrelated to the problem):
and (class='P'
OR code='m'
OR code='PC'
OR code='PCL')
-->
and class IN ('P', 'm', 'PC', 'PCL')