Hi!
I am trying to reindex multiple indexes into one.
Right now, My code looks like this.
- Create the destination index with
settings.number_of_replicas = 0
. - Iterate over source index one by one and reindex each index into the destination index.
All source indexes are guaranteed to have the same mapping. Right now, I am not copying over mapping of one of the source index(since they are all the same) to destination index and this seems to be working fine.
However, I am wondering if this is something I should do because I think it may help in better handling errors? I am not really a 100% sure.
Here is what the reindex operation looks like,
curl -XPOST "http://elasticsearch:9200/_reindex?requests_per_second=115&wait_for_completion=true" -H 'Content-Type: application/json' -d'
{
"source": {
"index": "analytics-prod-2019.12.30",
"size": 1000
},
"dest": {
"index": "analytics-prod-2019.12"
},
"script": {
"lang": "painless",
"source": " ctx._source.index = ctx._index; def eventData = ctx._source[\"event.data\"]; if (eventData != null) { eventData.remove(\"realmDb.size\"); eventData.remove(\"realmDb.format\"); eventData.remove(\"realmDb.contents\"); }"
}
}'