参考https://www.cnblogs.com/YangJiaXin/p/11153579.html
mariadb 自定义分词无用
USE mysql;
CREATE TABLE my_stopwords(VALUE VARCHAR(30)) ENGINE = INNODB;
INSERT INTO my_stopwords(VALUE) VALUE (',');
SET GLOBAL innodb_ft_server_stopword_table = 'mysql/my_stopwords';
或者直接添加 my.cnf添加:
[mysqld]
innodb_ft_min_token_size=2
innodb_ft_server_stopword_table = 'mysql/my_stopwords';
-- 查看
SHOW GLOBAL VARIABLES WHERE Variable_name IN('innodb_ft_min_token_size','innodb_ft_server_stopword_table');
直接创建全文索引
alter table test_search add fulltext index idx_full_keyword(name);
explain SELECT FROM test_search where match(name) against('%反转%');
explain SELECT FROM test_search where match(name) against('哲理,悲剧' in boolean mode);