【发布时间】:2016-04-25 23:33:50
【问题描述】:
首先我想设置 ES 的默认分析器,但失败了。然后根据其他问题和网站,我正在尝试设置一个索引的默认分析器。但是也有一些问题。
我已经配置了ik分析器,我可以设置一些字段的分析器,这是我的命令:
curl -XPUT localhost:9200/test
curl -XPUT localhost:9200/test/test/_mapping -d'{
"test":{
"properties":{
"name":{
"type":"string",
"analyzer":"ik"
}
}
}
}'
并得到消息:
{"acknowledged":true}
而且,它也如我所愿。
但是,如果我尝试设置索引的默认分析器:
curl -XPOST localhost:9200/test1?pretty -d '{ "index":{
"analysis" : {
"analyzer" : {
"default" : {
"type" : "ik"
}
}
}
}
}'
我会收到错误信息:
{
"error" : {
"root_cause" : [ {
"type" : "index_creation_exception",
"reason" : "failed to create index"
} ],
"type" : "illegal_argument_exception",
"reason" : "no default analyzer configured"
},
"status" : 400
}
很奇怪,不是吗? 期待您对这个问题的意见。谢谢! :)
【问题讨论】:
标签: elasticsearch elasticsearch-plugin