【发布时间】:2019-07-02 15:08:29
【问题描述】:
好吧,假设我有一个很少更新的弹性搜索索引。每次更新时我都需要更改它的版本。
例如: 首先我创建索引
PUT /test_index
{
"settings": {
"number_of_shards": 3,
"number_of_replicas": 1 },
"mappings": {
"student_data": {
"properties": {
"name": {"type": "keyword" },
"grade": { "type": "float" },
"created_date": { "type": "float"}
}
}
}
}
创建创建的索引设置后,我得到
"settings": {
"index": {
"creation_date": "1549622658089",
"number_of_shards": "3",
"number_of_replicas": "1",
"uuid": "xxxxxxxxx",
"version": {
"created": "6050199"
},
"provided_name": "test_index"
}
我需要改变这个
"version": {"created": "6050199"}
每次我更新索引中的文档时。有没有办法做到这一点? 提前谢谢你。
仅供参考:我尝试在创建索引时添加版本,例如,
PUT /test_index
{
"settings": {
"number_of_shards": 3,
"number_of_replicas": 1,
"version": 2
},
"mappings": {
"student_data": {
"properties": {
"name": {"type": "keyword"},
"grade": {"type": "float"},
"created_date": {"type": "float"}
}
}
}
}
但我得到了错误,
{ "error": {"root_cause": [{ "type": "illegal_argument_exception", "reason": "unknown setting [index.version] 请检查是否安装了任何必需的插件,或检查重大更改文档对于已删除的设置" }], "type": "illegal_argument_exception", "reason": "unknown setting [index.version] 请检查是否安装了任何必需的插件,或检查已删除设置的重大更改文档" },"status ":400}
【问题讨论】:
标签: elasticsearch