我正在开发AWS Elasticsearch。它不允许打开/关闭索引,因此无法对索引应用设置更改。
为了更改索引的设置,我必须创建一个具有新设置的新索引,然后将旧索引中的数据移动到新索引中。
所以首先我创建了一个新的索引
PUT new_index
{
"settings": {
"max_result_window":3000000,
"analysis": {
"filter": {
"german_stop": {
"type": "stop",
"stopwords": "_german_"
},
"german_keywords": {
"type": "keyword_marker",
"keywords": ["whatever"]
},
"german_stemmer": {
"type": "stemmer",
"language": "light_german"
}
},
"analyzer": {
"my_german_analyzer": {
"tokenizer": "standard",
"filter": [
"lowercase",
"german_stop",
"german_keywords",
"german_normalization",
"german_stemmer"
]
}
}
}
}
}它成功了。然后,我尝试使用query将数据从旧索引移动到新索引中:
POST _reindex
{
"source": {
"index": "old_index"
},
"dest": {
"index": "new_index"
}
}失败的原因是
Request failed to get to the server (status code: 504)我用_cat api检查了索引,它给出了
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open old_index AGj8WN_RRvOwrajKhDrbPw 5 1 2256482 767034 7.8gb 7.8gb
yellow open new_index WnGZ3GsUSR-WLKggp7Brjg 5 1 52000 0 110.2mb 110.2mb似乎有一些数据被加载到其中,只是想知道为什么_reindex不能工作。
发布于 2017-12-06 22:36:04
您可以通过api查看reindex的状态:
GET _tasks?detailed=true&actions=*reindex在响应中有一个"status“对象,其字段为"total":
total是重新索引期望执行的操作总数。您可以通过添加更新、创建和删除的字段来估计进度。当它们的总和等于总字段时,请求将结束。
ES文档链接:https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html
https://stackoverflow.com/questions/43806999
复制相似问题