一、内置分词器的介绍
例:Set the shape to semi-transparent by calling set_trans(5)
standard analyzer(默认): set, the, shape, to, semi, transparent, by, calling, set_trans, 5
simple analyzer: set, the, shape, to, semi, transparent, by, calling, set, trans
whitespace analyzer: Set, the, shape, to, semi-transparent, by, calling, set_trans(5)
language analyzer: set, shape, semi, transpar, call, set_tran, 5
二、测试分词器
GET /_analyze
{
“analyzer”: “standard”,
“text”: “Text to analyze”
}
三、IK中文分词器
1.步骤:
git clone https://github.com/medcl/elasticsearch-analysis-ik
mvn package
将 target/releases/elasticsearch-analysis-ik-...zip 拷贝到 es/plugins/ik 目录下
在 es/plugins/ik 下对elasticsearch-analysis-ik-...zip 进行解压缩
重启 es
2.两种 analyzer
ik_max_word: 会将文本做最细粒度的拆分