Bug #91437 | FULLTEXT index with ngram parser returns unexpected reults | ||
---|---|---|---|
Submitted: | 27 Jun 2018 12:04 | Modified: | 28 Jun 2018 9:12 |
Reporter: | Sylvain Estevez | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server: FULLTEXT search | Severity: | S2 (Serious) |
Version: | 5.7.19, 5.7.22 | OS: | MacOS |
Assigned to: | CPU Architecture: | Any | |
Tags: | fulltext, INDEX, NGRAM, search |
[27 Jun 2018 12:04]
Sylvain Estevez
[27 Jun 2018 13:34]
Sylvain Estevez
Given the table in the reproduction steps, and adding a row with `david` as email value: searching for `david` does not return any results.
[28 Jun 2018 1:24]
Tsubasa Tanaka
I think this relates Bug#82330. Workaround is setting empty stopword table. mysql57> CREATE TABLE stopwords (value varchar(255) NOT NULL PRIMARY KEY); Query OK, 0 rows affected (0.16 sec) mysql57> SET GLOBAL innodb_ft_server_stopword_table = 'd1/stopwords'; Query OK, 0 rows affected (0.02 sec) https://bugs.mysql.com/bug.php?id=82330 (From Japan MySQL User Group)
[28 Jun 2018 9:12]
MySQL Verification Team
Hello Sylvain, Thank you for the report and test case. This is most likely duplicate of Bug #82330, please see Bug #82330 As Tanaka-San suggested, work around is ##### mysql> CREATE TABLE stopwords (value varchar(255) NOT NULL PRIMARY KEY); Query OK, 0 rows affected (0.01 sec) mysql> SET GLOBAL innodb_ft_server_stopword_table = 'd1/stopwords'; Query OK, 0 rows affected (0.00 sec) mysql> CREATE TABLE `ngram_test` ( -> email VARCHAR(150) NOT NULL, -> PRIMARY KEY (`email`), -> FULLTEXT KEY `email_ngram` (`email`) /*!50100 WITH PARSER `ngram` */ -> ); Query OK, 0 rows affected (0.04 sec) mysql> INSERT INTO `ngram_test` (`email`) VALUES ('nicolas.lich@toto.com'), ('Katlynn.Connelly@gmail.com'), ('nicolasch@foo.com'), ('alexbraico@me.com'), ('sylvain+old@flux.com'), ('6@flux.com'); Query OK, 6 rows affected (0.01 sec) Records: 6 Duplicates: 0 Warnings: 0 mysql> SELECT `email` FROM `ngram_test` WHERE ((MATCH(`email`) AGAINST('+nico' IN BOOLEAN MODE))); +-----------------------+ | email | +-----------------------+ | nicolas.lich@toto.com | | nicolasch@foo.com | +-----------------------+ 2 rows in set (0.00 sec) mysql> SELECT `email` FROM `ngram_test` WHERE ((MATCH(`email`) AGAINST('+sylv' IN BOOLEAN MODE))); +----------------------+ | email | +----------------------+ | sylvain+old@flux.com | +----------------------+ 1 row in set (0.00 sec) Thanks, Umesh