网上很多例子查看分析的结果都为:
curl -i -XGET 'http://localhost:9200/website/_analyze?text=du lo'
但是我在用的时候一直报错:
{
"error": {
"root_cause": [{
"type": "index_not_found_exception",
"reason": "no such index",
"resource.type": "index_or_alias",
"resource.id": "bad-request",
"index_uuid": "_na_",
"index": "bad-request"
}],
"type": "index_not_found_exception",
"reason": "no such index",
"resource.type": "index_or_alias",
"resource.id": "bad-request",
"index_uuid": "_na_",
"index": "bad-request"
}
更改下获取的方式为 dsl方式为:
curl -i -XGET 'http://localhost:9200/website/_analyze?pretty' -d '{"text":"du lo"}' 可以访问啦