使用netstat -lntp来看看有侦听在网络某端口的进程。当然,也可以使用 lsof。

IK分词器设置了用户词典某些词仍然不会被认为是一个词?

Elasticsearch | 作者 a377299 | 发布于2017年11月23日 | 阅读数:2683

例如,我将一只股票名 “深深宝A”加入了用户词典,分词之后仍然是如下结果,
{
    "tokens": [
        {
            "token": "深深",
            "start_offset": 0,
            "end_offset": 2,
            "type": "CN_WORD",
            "position": 0
        },
        {
            "token": "宝",
            "start_offset": 2,
            "end_offset": 3,
            "type": "CN_CHAR",
            "position": 1
        },
        {
            "token": "a",
            "start_offset": 3,
            "end_offset": 4,
            "type": "ENGLISH",
            "position": 2
        }
    ]
}
 
有没有遇到这种情况的,我初步猜测是有英文a的原因,不知道如何解决
已邀请:

jiangtao

赞同来自:

应该是词库未生效所致。你所使用的词库是否有定时更新机制?
我将其添加到词库中,分词结果如下:
{
tokens: [
{
token: "深深宝a",
start_offset: 0,
end_offset: 4,
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: "a",
start_offset: 3,
end_offset: 4,
type: "OTHER_CJK",
position: 3
}
]
}

laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net

赞同来自:

重建索引了吗?更新分词需要重建索引才生效

phoenix

赞同来自:

要不重建索引,要不用个新field。

要回复问题请先登录注册