NOTE
1.6 Elasticsearch分词器
分词器把句子拆成词,并进行规范化处理。笔记从提高搜索匹配能力的需求出发,整理 Elasticsearch 的分词过程。
这是历史学习笔记,可能存在过时或不完整的理解。
1. 什么是分词器
把一段句子分成一个个单词,对每个单词进行normalization
1.1. 召回率
搜索的时候增加能够搜索到的结果的数量
2. 分词器的构成
2.1. character filter
在一段文本进行分词之前,先进行预处理,比如说最常见的就是,过滤html标签(hello –> hello),& –> and(I&you –> I and you)
2.2. tokenizer
分词,hello you and me –> hello, you, and, me
2.3. token filter
lowercase,stop word,synonymom,dogs –> dog,liked –> like,Tom –> tom,a/the/an –> 干掉,mother –> mom,small –> little
3. 安装IK Analyzer
- 下载https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.4.2/elasticsearch-analysis-ik-7.4.2.zip
- 解压到elasticsearch-5.2.0\plugin\ik下
- 重启es
4. 参考
拖动可平移,滚轮缩放,点击节点可展开或折叠。大型导图默认折叠较深层级,可点击节点继续展开。
讨论
使用 GitHub 账号参与讨论,评论会保存在 GitHub Issues 中。在 GitHub 查看