# NOT RUN {
x <- connect()
if (!index_exists(x, "twitter")) index_create(x, "twitter")
if (!index_exists(x, "new_twitter")) index_create(x, "new_twitter")
body <- '{
"source": {
"index": "twitter"
},
"dest": {
"index": "new_twitter"
}
}'
reindex(x, body = body)
# }
Run the code above in your browser using DataLab