【发布时间】:2019-03-24 23:56:49
【问题描述】:
我是弹性搜索的新手。我有一个索引类型如下
{
"myindex" : {
"mappings" : {
"systemChanges" : {
"_all" : {
"enabled" : false
},
"properties" : {
"autoChange" : {
"type" : "boolean"
},
"changed" : {
"type" : "object",
"enabled" : false
},
"created" : {
"type" : "date",
"format" : "strict_date_optional_time||epoch_millis"
}
}
}
}
}
}
我无法获取已更改的详细信息。新 = 已完成。经过一些研究,我发现这是因为更改的字段设置为启用:false。我需要改变同样的。我尝试如下
curl -X PUT "localhost:9200/myindex/" -H 'Content-Type: application/json' -d' {
"mappings": {
"systemChanges" : {
"properties" : {
"changed" : {
"enabled" : true
}
}
}
}
}'
但我收到以下错误。
{"error":{"root_cause":[{"type":"index_already_exists_exception","reason":"已经存在","index":"myindex"}],"type":"index_already_exists_exception", "reason":"已经存在","index":"myindex"},"status":400}
如何将 enabled 更改为 true 以获取 changed.new 字段的详细信息?
【问题讨论】:
标签: elasticsearch