Java OpenResty Spring Spring Boot MySQL Redis MongoDB PostgreSQL Linux Android Nginx 面试 小程序 Arthas JVM AQS juc Kubernetes Docker 诊断工具


MySQL 中文全文检索 ngram 处理停止词

MySQL 索引 全文检索 大约 394 字

ngram 中文分词处理器

添加中文全文检索索引

ALTER TABLE post ADD FULLTEXT INDEX ft_index (title,content) WITH PARSER ngram;

处理停止词,在my.cnfmy.ini[mysqld]下配置

ngram_token_size=2

InnoDB 存储引擎

查看ngram如何标记文本

SET GLOBAL innodb_ft_aux_table="z-blog/post";

SELECT 
    *
FROM
    information_schema.innodb_ft_index_cache
ORDER BY doc_id , position;

参考文档

https://dev.mysql.com/doc/refman/5.7/en/fulltext-search-ngram.html

阅读 4493 · 发布于 2019-04-04

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb

扫描下方二维码关注公众号和小程序↓↓↓

扫描二维码关注我
昵称:
随便看看 换一批