报错如下:
{
"error": {
"root_cause": [
{
"type": "remote_transport_exception",
"reason": "[node45-1][ip:9300][indices:admin/analyze[s]]"
}
],
"type": "illegal_argument_exception",
"reason": "failed to find analyzer [hanlp-index]"
},
"status": 400
};
{
"error": {
"root_cause": [
{
"type": "remote_transport_exception",
"reason": "[node45-1][ip:9300][indices:admin/analyze[s]]"
}
],
"type": "illegal_argument_exception",
"reason": "failed to find analyzer [hanlp-index]"
},
"status": 400
};
3 个回复
wenjian
赞同来自:
Fisher - 鱼仔
赞同来自:
curl -XGET 'http://<ip>:<port>/_analyze?pretty&analyzer=hanlp-index' -H 'Content-Type: application/json' -d ' { "text": [ "分词测试" ] } '
直接测一下
liuxg - Elastic
赞同来自:
{
"tokens" : [
{
"token" : "美国",
"start_offset" : 0,
"end_offset" : 2,
"type" : "nsf",
"position" : 0
},
{
"token" : "阿拉斯加州",
"start_offset" : 2,
"end_offset" : 7,
"type" : "nsf",
"position" : 1
},
{
"token" : "发生",
"start_offset" : 7,
"end_offset" : 9,
"type" : "v",
"position" : 2
},
{
"token" : "8.0",
"start_offset" : 9,
"end_offset" : 12,
"type" : "m",
"position" : 3
},
{
"token" : "级",
"start_offset" : 12,
"end_offset" : 13,
"type" : "q",
"position" : 4
},
{
"token" : "地震",
"start_offset" : 13,
"end_offset" : 15,
"type" : "n",
"position" : 5
}
]
}
你有没有使用如下的命令检查安装是否成功:
$ ./bin/elasticsearch-plugin list
analysis-hanlp
如果安装成功的话,就会显示有上面的结果。
另外安装后,必须重新启动Elasticsearch才可以起作用。