ElasticSearch版本我用6.6.1
我已经通过运行以下命令curl -XPUT http://localhost:9200/incident_422?-H 'Content-Type创建了索引:application/json' -d @elasticsearch.json
我需要用示例JSON数据更新索引文件。(sample.json)
{
"properties": {
"id185": {
"type": "byte"
},
"id255": {
"type": "text"
},
"id388": {
"type": "text"
}
}
}
我尝试运行命令curl -XPUT http://localhost:9200/incident_422/mapping/_doc?-H 'Content-Type:application/json' -d @sample.json
但是我得到错误消息说{“error”:{“root_cause”:[{“type”:“illegal_argument_exception”,“reason”:“Rejecting mapping update to [incident_422] as the final mapping would have more than 1 type:[mapping,doc]"}]
我在某个地方读到过ELK 6不支持两种以上的类型。
有没有人可以告诉我,如何才能做到这一点,而不降级的版本
1条答案
按热度按时间nhhxz33t1#
这似乎与removal of mapping type有关,您需要在索引文档时指定类型名称。
尝试添加类型到您的索引请求aka
http://localhost:9200/incident_422/<your-type-name>
在您的URL,它应该解决这个问题。