mysql与3字符表达式的匹配

8e2ybdfx  于 2021-06-18  发布在  Mysql
关注(0)|答案(1)|浏览(380)

当我运行以下命令时 MATCH(my_text) AGAINST ('"hey"' IN BOOLEAN MODE) 我得到所有包含 hey 当我运行以下命令时 MATCH(my_text) AGAINST ('"n=3"' IN BOOLEAN MODE) 即使有两行包含 n=3 这张table有 fulltext 指数 utf8_general_ci 校勘
ENGINE=InnoDB innodb_ft_min_token_size = 3 ft_min_word_len = 4 mysql version = 5.6.10 我怀疑这和 = 但不知道怎么用 *()+ 为了表现出它需要的样子,尝试了几种不同的组合,但没有成功。

nue99wik

nue99wik1#

= 未被视为单词字符,因此未编制索引
发件人:https://dev.mysql.com/doc/refman/8.0/en/fulltext-fine-tuning.html
字符集修改
对于内置的全文解析器,可以通过多种方式更改被视为单词字符的字符集,如下表所述。修改后,为包含任何全文索引的每个表重新生成索引。假设要将连字符('-')视为单词字符。使用以下方法之一:

Modify the MySQL source: In storage/innobase/handler/ha_innodb.cc (for InnoDB), or in storage/myisam/ftdefs.h (for MyISAM), see the

true\u word\u char()和misc\u word\u char()宏。将“-”添加到其中一个宏并重新编译mysql。

Modify a character set file: This requires no recompilation. The true_word_char() macro uses a “character type” table to distinguish

其他字符的字母和数字。您可以编辑其中一个字符集xml文件中数组的内容,以指定“-”是“字母”。然后将给定的字符集用作全文索引。有关数组格式的信息,请参阅第10.12.1节“字符定义数组”。

Add a new collation for the character set used by the indexed columns, and alter the columns to use that collation. For general

有关添加排序规则的信息,请参阅第10.13节“向字符集添加排序规则”。有关特定于全文索引的示例,请参阅第12.9.7节“为全文索引添加排序规则”。

相关问题