如果我想重启一切?我怎么做?
我目前正在开发搜索,我想重置。
问题是我删除了索引并返回:
200 OK {"acknowledged":true}
所以我更新了我得到的映射:
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Failed to parse mapping [person]: mapper [country] cannot be changed from type [string] to [int]"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [person]: mapper [country] cannot be changed from type [string] to [int]","caused_by":{"type":"illegal_argument_exception","reason":"mapper [country] cannot be changed from type [string] to [int]"}},"status":400}
问题是我用另一个名字创建了另一个索引,我遇到了同样的问题:
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Failed to parse mapping [person]: mapper [country] cannot be changed from type [string] to [int]"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [person]: mapper [country] cannot be changed from type [string] to [int]","caused_by":{"type":"illegal_argument_exception","reason":"mapper [country] cannot be changed from type [string] to [int]"}},"status":400}
我使用以下方式创建它:
{
"settings" : {
"number_of_shards" : 1,
"analysis": {
"analyzer": {
"sortable": {
"type": "custom",
"tokenizer": "keyword",
"filter": [
"lowercase"
]
}
}
}
},
"mappings" : {
// Left out on purpose.
}
}
我真的不关心我想要以最快的方式创建新索引的数据。映射是否存储在与索引不同的位置?我认为如果删除索引,类型+数据就会消失。
答案 0 :(得分:0)
我假设您在删除索引时没有停止索引。默认情况下,elasticsearch将为您创建索引和映射。你可以disable autocreation。或者您可以确保索引已停止