发布时间:2022-08-19 13:35
use test;
show variables like 'innodb_ft_min_token_size';
## innodb_ft_min_token_size 2
show variables like 'ft%';
## ft_min_word_len 1
REPAIR TABLE product;
show create table product;
CREATE TABLE `product` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`title` varchar(200) NOT NULL DEFAULT '' COMMENT '商品名称',
PRIMARY KEY (`id`),
FULLTEXT KEY `full_title` (`title`) with parser ngram
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
## 注意这里一定要用到 with parser ngram
alter table product add FULLTEXT KEY `full_title` (`title`) with parser ngram;
insert into product(title)values('青岛啤酒'),('雪花啤酒'),('哈尔滨啤酒'),('牛栏山二锅头'),('红星二锅头'),('are you ok?'),('how are you'),('how do you do'),('what are you doing now?'),('hello');
select * from product;
select * from product where match(title) against('you' In natural language mode);
select * from product where match(title) against('哈尔滨');
select * from product where match(title) against('"青岛"' IN BOOLEAN MODE);
## 重建索引
REPAIR TABLE product QUICK;
ALTER TABLE product ENGINE=INNODB;
OPTIMIZE TABLE product;
Vexip UI - 新轮子推荐,由个人开发者打造的 Vue3 UI 组件库,免费开源、开箱即用
线上活动| 如何运用 MongoDB 可调一致性?报名直播技术大佬带你了解!
【Java面试】Spring中 BeanFactory和FactoryBean的区别
面试官:v-show和v-if有什么区别?使用场景分别是什么?
python库入门_Python入门系列:Python标准库
kafka查看broker上主副本_Apache-Kafka核心概念
一个接口优雅的实现 Spring Cloud OAuth2 自定义token返回格式
【论文笔记-视频行为识别】Two-Stream Convolutional Networks for Action Recognition in Videos