我向现有数据库添加了全文索引,但我的全文索引查询找不到现有记录。
引擎:InnoDB DB:mysql 全文模式:布尔模式
当我运行以下查询时,我找不到任何记录
select * from user_data user
where user.is_deleted=0 and
MATCH(user.family_name,user.given_name)
AGAINST('USS_FUBQ_gen_given_name' in boolean mode);
但是当我跑步时
select * from user_data user
where user.is_deleted=0 and
MATCH(user.family_name,user.given_name)
AGAINST('uss_fubq_gen_given_name' in boolean mode);
我得到了预期的输出。预期输出:
familyName | given name
USS_FUBQ_gen_family_name | USS_FUBQ_gen_given_name
我的表定义:
CREATE TABLE user_data (
user_id varchar(36) COLLATE utf8_bin NOT NULL,
family_name varchar(50) COLLATE utf8_bin DEFAULT NULL,
gender char(1) COLLATE utf8_bin DEFAULT NULL,
given_name varchar(50) COLLATE utf8_bin DEFAULT NULL,
middle_names varchar(100) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (user_id),
FULLTEXT KEY ix_full_text_index_by_name (family_name,given_name),
[...] ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin