Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 10.0.21
-
Fix Version/s: N/A
-
Component/s: Documentation, Full-text Search
-
Labels:None
-
Environment:Debian GNU/Linux 7.6 (wheezy) / mariadb 10.0.21
Description
innodb tables, doesn't use the ft_min_word_len, unlike myisam table, the ft_min_word_len, used by innodb table is always 4 (as the default value).
ex:
CREATE TABLE `ftx` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`_search` VARCHAR(250) DEFAULT NULL,
PRIMARY KEY (`id`),
FULLTEXT KEY `search` (`_search`)
) ENGINE=INNODB DEFAULT CHARSET=utf8;
INSERT INTO ftx (_search) VALUES ('yi wu') ;
INSERT INTO ftx (_search) VALUES ('yi wux') ;
INSERT INTO ftx (_search) VALUES ('yi wuxo') ;
mysql> SELECT * FROM ftx; +----+---------+ | id | _search | +----+---------+ | 1 | yi wu | | 2 | yi wux | | 3 | yi wuxo | +----+---------+
mysql> SHOW VARIABLES LIKE 'ft_min_word_len';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| ft_min_word_len | 2 |
+-----------------+-------+
mysql> SELECT * FROM `ftx` WHERE (MATCH (_search) AGAINST ('wu')) ;
Empty set (0.00 sec)
and with isam table that's ok.
DROP TABLE ftx;
CREATE TABLE `ftx` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`_search` VARCHAR(250) DEFAULT NULL,
PRIMARY KEY (`id`),
FULLTEXT KEY `search` (`_search`)
) ENGINE=MYISAM DEFAULT CHARSET=utf8;
INSERT INTO ftx (_search) VALUES ('yi wu') ;
INSERT INTO ftx (_search) VALUES ('yi wux') ;
INSERT INTO ftx (_search) VALUES ('yi wuxo') ;
mysql> SELECT * FROM `ftx` WHERE (MATCH (_search) AGAINST ('wu')) ;
+----+---------+
| id | _search |
+----+---------+
| 1 | yi wu |
+----+---------+
1 row in set (0.00 sec)
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
It is not a bug on the server side. ft_min_word_len is a MyISAM fulltext-search option, InnoDB has its own: innodb_ft_min_token_size.
But we do need to update documentation to mention that ft_min_word_len (and some other options) are MyISAM-specific. MySQL has already done it in their manual.