The length of the word in a FULLTEXT search. The size of the ft_min_word_len key.

The FULLTEXT key search is faster than the usual LIKE search, but its use is limited by the number of characters in the search word. Full text indexes are supported by MyISAM tables. Innodb support has been added since version 5.6.4.

Check the number of characters you are looking for :

SHOW VARIABLES LIKE ' ft_min_word_len '

Set the required quantity :

In the config file /etc/mysql/my.cnf (it may differ for different OS)

[mysqld]
ft_min_word_len=3

Restart mysql (mysqld or mariadb):

sudo service mysql restart

It is advisable to reset the cache of the table that will be searched:

REPAIR TABLE table QUICK;
FLUSH table table;

Adding a FULLTEXT key:

ALTER TABLE ` table ` ADD FULLTEXT(` field `);

Now the search for three or more characters will work without difficulty :

SELECT * FROM table
WHERE MATCH ( field ) AGAINST (' +Пик ' IN BOOLEAN MODE);

819 0

Comments

Be the first to review this item. Share your rating and review so that other customers can decide if this is the right item for them.
You have to log in to leave a comment. Sign in

Similar articles

Mysql database of tires and disks

Base of automobile tires and disks. The database contains: manufacturer, model, year, modification, PCD, diameter, nut, tire and wheel factory sizes, possible replacement options, tire and wheel tuning. There are no trucks in the database.

Disabling sql_mode=only_full_group_by in mysql 5.7 ubuntu 18.04

What to do if the error SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'db.books' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by