Created
August 31, 2018 03:30
-
-
Save gigkokman/3d33eec724b52cd151419ef19476d390 to your computer and use it in GitHub Desktop.
Reindexing Elasticsearch for daily indices
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
POST _reindex | |
{ | |
"source": { | |
"index":"test_fields-*", | |
"_source": { | |
"includes": ["field1", "field2"] | |
} | |
}, | |
"dest": { | |
"index": "test_fields" | |
}, | |
"script": { | |
"lang": "painless", | |
"source": "ctx._index = 'test_fields-' + (ctx._index.substring('test_fields-'.length(), ctx._index.length())) + '-1'" | |
} | |
} |
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
POST test_fields-2018.08.31/doc | |
{ | |
"field1": "field 1", | |
"field2": "field 2", | |
"field3": "field 3", | |
"field4": "field 4" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment