从ElasticSearch 2.3开始,您现在可以使用内置的_reindex
API
例如:
POST /_reindex
{
"source": {
"index": "twitter"
},
"dest": {
"index": "new_twitter"
}
}
POST /_reindex
{
"source": {
"index": "twitter",
"query": {
"term": {
"user": "kimchy"
}
}
},
"dest": {
"index": "new_twitter"
}
}
了解更多:https://www.elastic.co/guide/en/elasticsearch/reference/current/docs- reindex.html