不为失败找理由,要为成功找方法。

ik分词 maxword的slop

Elasticsearch | 作者 Wen Tan | 发布于2017年10月24日 | 阅读数:2691

ik max word 用了之后就不支持slop 了?position已经丢失了原有的位置信息
搜索的时候采用ik_smart搜索
如 长春市市长 如果用match_phrase就无法匹配到了
{
"tokens": [
{
"token": "长春市",
"start_offset": 0,
"end_offset": 3,
"type": "CN_WORD",
"position": 0
},
{
"token": "长春",
"start_offset": 0,
"end_offset": 2,
"type": "CN_WORD",
"position": 1
},
{
"token": "市",
"start_offset": 2,
"end_offset": 3,
"type": "CN_CHAR",
"position": 2
},
{
"token": "市长",
"start_offset": 3,
"end_offset": 5,
"type": "CN_WORD",
"position": 3
}
]
}
已邀请:

medcl - 今晚打老虎。

赞同来自:

max_word 的 position 确实是有重叠,所以不适合 phrase 查询

Wen Tan

赞同来自:

自己回答一下 
采用phrase查询很难做到召回率,
推荐采用普通检索 提高召回率
然后采用Rescore 提升词组的分数

要回复问题请先登录注册