[MDEV-8780] fulltext index on innodb table doesn't honor ft_min_word_len Created: 2015-09-09  Updated: 2015-11-03  Resolved: 2015-09-10

Status: Closed
Project: MariaDB Server
Component/s: Documentation, Full-text Search
Affects Version/s: 10.0.21
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Christophe Vigny Assignee: Ian Gilfillan
Resolution: Fixed Votes: 0
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)



 Comments   
Comment by Elena Stepanova [ 2015-09-10 ]

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.

Comment by Ian Gilfillan [ 2015-09-10 ]

The documentation has now been updated.

Comment by Christophe Vigny [ 2015-11-03 ]

hi all,

thank's for your quick response.
I have just installed the 10.0.22 and I just see the the bug is still present in that release.

sorry I have just see your explanation .

thank you elena.

Generated at Thu Feb 08 07:29:45 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.