Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ik_smart分词结果不是ik_max_word的子集吗 #584

Open
inahero opened this issue Aug 14, 2018 · 15 comments
Open

ik_smart分词结果不是ik_max_word的子集吗 #584

inahero opened this issue Aug 14, 2018 · 15 comments

Comments

@inahero
Copy link

inahero commented Aug 14, 2018

之前一直以为是这样的。所以用ik_max_word建索引,用ik_smart搜索,结果匹配不上是两边分词结果不是包含关系造成的

@84yy
Copy link

84yy commented Nov 3, 2018

同样存在这个疑问

@inahero
Copy link
Author

inahero commented Nov 8, 2018

不一致好像是smart的特性导致的,
合并量词导致:
输入: 7号电池
ik_max_word:7|号|电池
ik_smart:7号|电池
消除歧义导致:
输入:美国力特
ik_max_word:美国|国力|特
ik_smart:美|国力|特

@inahero
Copy link
Author

inahero commented Nov 8, 2018

在ik_max_word的分词结果任意组合不能拼接出原始词的情况下,是ik_smart的分词结果不包含于ik_max_word的分词结果的原因之一

@HelloClyde
Copy link

在ik_max_word的分词结果任意组合不能拼接出原始词的情况下,是ik_smart的分词结果不包含于ik_max_word的分词结果的原因之一

那这个有参数可以关吗?

@inahero
Copy link
Author

inahero commented Jan 10, 2019

好像老的版本的ik_max_word是能把单字给分出来的

@inahero
Copy link
Author

inahero commented Jan 11, 2019

在ik_max_word的分词结果任意组合不能拼接出原始词的情况下,是ik_smart的分词结果不包含于ik_max_word的分词结果的原因之一

那这个有参数可以关吗?

我后来是把extra_single_word_full.dic加载进来了,这样子对汉字是可以保证ik_smart是ik_max_word的子集

@inahero
Copy link
Author

inahero commented Jan 11, 2019

不过还有数词合并的搜不到

@HelloClyde
Copy link

这个问题太严重了,我还是决定换分词插件

@medcl
Copy link
Member

medcl commented Jan 13, 2019

本来就两种类型的分词结果,最好不用混用。

@failable
Copy link

failable commented May 9, 2020

README里的例子不是混用吗?

@liqiling170
Copy link

如果你有停用词,需要混用,检索的时候用 ik_max_word, 索引的时候用 ik_smart , ik_max_word 会包含停用词, 但是ik_smart 不会包含,这样更精确。例子,维生素缺乏, 如果维生素是停用词, 那 ik_smart 不会包含维生素, 而 ik_max_word 会包含维生素,这样就永远不会搜出 维生素缺乏, 此时如果检索也用 ik_smart , 检索的维生素会被停用,实际效果相当于检索包含 缺乏 的文档

@liqiling170
Copy link

而都用 ik_max_word 的话,感觉实际效果就相当于 正则匹配 了, 字典没有用

@liu316484231
Copy link

貌似只能设置自定义词典临时解决一下了,有点坑

@wadekun
Copy link

wadekun commented Dec 23, 2020

本来就两种类型的分词结果,最好不用混用。

image

也就是不能这样设置了?

@tenlee2012
Copy link

这个问题太严重了,我还是决定换分词插件
可以试试这个分词器
https://github.com/tenlee2012/elasticsearch-analysis-hao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants