MYSQL布尔全文搜索首选不带+的搜索词-为什么?

时间:2019-04-04 11:15:56

标签: mysql full-text-search innodb

我有一个名为name的Mysql Innodb全文索引列。如果我对记录的确切名称进行布尔搜索,则如果我在搜索词前加上+,则得分会高得多。谁能解释一下?我希望它是一样的,因为这是“比较喜欢它”与“必须要这个”的情况。

mysql> SELECT record_id, name, "abcde" as search_term, 
       MATCH (name) AGAINST ("abcde" IN BOOLEAN MODE) AS score_without_plus, 
       MATCH (name) AGAINST ("+abcde" IN BOOLEAN MODE) AS score_with_plus 
       FROM my_tablename WHERE record_id = 16;
+-----------+-------+-------------+--------------------+-----------------------+
| record_id | name  | search_term | score_without_plus | score_with_plus       |
+-----------+-------+-------------+--------------------+-----------------------+
|        16 | abcde | abcde       |  4.034474849700928 | 0.0016093916492536664 |
+-----------+-------+-------------+--------------------+-----------------------+

没有+的版本得分超过2500倍,这似乎很疯狂。谁能解释这是怎么回事?

0 个答案:

没有答案