为什么此MYSQL全文搜索没有得分?

时间:2019-04-03 11:06:07

标签: mysql full-text-search

我在表(squirrel_users中有这样一条记录,该记录在email上具有全文本索引。

+-----------+----------------------------+
| record_id | email                      |
+-----------+----------------------------+
|      7065 | s.j.e.hennessyexample.com  |
+-----------+----------------------------+

但是,如果我在布尔模式下对电子邮件进行匹配,则不会得到分数:

mysql> SELECT record_id, email, 
(MATCH (email) AGAINST ("+s.j.e.hennessyexample.com" IN BOOLEAN MODE)) AS score 
FROM squirrel_users 
WHERE record_id = 7065 ORDER BY score DESC; 
+-----------+----------------------------+-------+
| record_id | email                      | score |
+-----------+----------------------------+-------+
|      7065 | s.j.e.hennessyexample.com  |     0 |
+-----------+----------------------------+-------+

有人在这里+<exact saved data>上看到为什么分数为零吗?也许和句号有关?

啊哈-如果我将其用引号引起来,那么它会起作用:

mysql> SELECT record_id, email, 
(MATCH (email) AGAINST ("+\"s.j.e.hennessyexample.com\"" IN BOOLEAN MODE)) AS score 
FROM squirrel_users 
WHERE record_id = 7065 ORDER BY score DESC;
+-----------+----------------------------+--------------------+
| record_id | email                      | score              |
+-----------+----------------------------+--------------------+
|      7065 | s.j.e.hennessyexample.com  | 25.576061248779297 |
+-----------+----------------------------+--------------------+
1 row in set (0.00 sec)

然后,句号发生了什么-他们是否将其分解,因此将其视为单独的单词?

0 个答案:

没有答案