Skip to content

Instantly share code, notes, and snippets.

@aplz
Created September 13, 2017 15:17
Show Gist options
  • Save aplz/1cd3205128e4c34c605278af8e4a4c8d to your computer and use it in GitHub Desktop.
Save aplz/1cd3205128e4c34c605278af8e4a4c8d to your computer and use it in GitHub Desktop.
Move document from one elasticsearch index to another
POST _reindex
{
"source": {
"index": "source_idx",
"type": "sourc_idx_type",
"query": {
"terms": {
"_id": [
"the_id"
]
}
}
},
"dest": {
"index": "target_idx",
"type": "target_idx_type"
}
}
POST source_idx/_delete_by_query
{
"query": {
"terms": {
"_id": [
"the_id"
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment