【发布时间】:2018-07-10 12:22:29
【问题描述】:
我使用的是 Elasticsearch 5.5 版。
我的索引 A 带有映射:
{
"myobj": {
"enabled": false
}
我用映射创建了索引 B:
{
"myobj": {
"_all": {"enabled": false},
"properties": {
"mykey": {"type": "keyword"}
}
}
}
当我用 body 调用 reindex api 时:
{
"source": {
"index": "a"
},
"dest": {
"index": "b"
}
}
我收到错误:Cannot generate dynamic mappings of type [_version] for [_version]
这是我尝试过的重新索引请求正文:
{
"source": {
"index": "a"
},
"dest": {
"index": "b",
"version_type": "internal"
}
}
==> Cannot generate dynamic mappings of type [_version] for [_version]
{
"source": {
"index": "a"
},
"dest": {
"index": "b",
"version_type": "external"
}
}
==> Cannot generate dynamic mappings of type [_version] for [_version]
{
"source": {
"index": "a"
},
"dest": {
"index": "b"
},
"script": {
"inline": "ctx._version = ctx._source.remove(\"_version\")"
}
}
==> [myobj][1]: version conflict, current version [-1] is different than the one provided [1507030478]
我做错了什么,如何重新索引这些文档?
编辑
此后我尝试添加 "conflicts": "proceed",这只是导致没有文档被重新索引。
我还在索引 B 的设置中添加了"index.mapper.dynamic": false,结果没有明显变化。
【问题讨论】:
-
你试过“冲突”:“继续”,
-
它没有帮助。
标签: elasticsearch reindex