Skip to content

Instantly share code, notes, and snippets.

@djptek
Created October 3, 2018 13:07
Show Gist options
  • Save djptek/2a71b42162c7e17fa4382f5791eb8e8c to your computer and use it in GitHub Desktop.
Save djptek/2a71b42162c7e17fa4382f5791eb8e8c to your computer and use it in GitHub Desktop.
_reindex merge using wildcard
DELETE my_*
PUT _template/template_1
{
"index_patterns": ["*"],
"order": 1,
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
POST my_source_1/_doc
{
"text": "from my_source_1"
}
POST my_source_2/_doc
{
"text": "from my_source_2"
}
POST _reindex
{
"source": {
"index": "my_source*"
},
"dest": {
"index": "my_dest"
},
"script": {
"source": "ctx._id = ctx._index + ':' + ctx._id",
"lang": "painless"
}
}
GET my_dest/_search
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment