我正在研究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"
]
}
}
}
}
}
成功了。然后,我尝试通过查询将数据从旧索引移动到新索引:
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为什么不起作用
谢谢
最佳答案
您可以使用api检查重新索引的状态:
GET _tasks?detailed=true&actions=*reindex
响应中有一个“状态”对象,其字段为“总计”:
total是重新索引期望执行的操作总数。您可以通过添加更新,创建和删除的字段来估计进度。当它们的总和等于总计字段时,请求将结束。
链接到ES文档:https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html
关于amazon-web-services - elasticsearch _reindex失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43806999/