Created
October 3, 2018 13:07
-
-
Save djptek/2a71b42162c7e17fa4382f5791eb8e8c to your computer and use it in GitHub Desktop.
_reindex merge using wildcard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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