How to rename index with reindex API

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



How to rename index with reindex API



I'm trying to rename an index on Elasticsearch and as suggested in the accepted solution of this question I'm using the Reindex API. I'm using the following command:


POST _reindex

"source":
"index": "original-index"
,
"dest":
"index": "new-index"




But I'm receiving this output:



"ok": false,
"message": "Unable to connect to the server."



I have tried creating the index before doing the reindex and without having it created and every time I get the same output. Any idea why? Thanks in advance.



EDIT:
I have just tested it again and it happens something strange. The index is being reindexed, but the error message is still being displayed. Any explanation about that? The message is confusing cause it seems to have failed, but it should be running still...





Are you running the command in Kibana?
– TheUknown
22 hours ago





Can you verify your elasticsaerch server is running or not ?
– Ashwani Shakya
12 hours ago





Yes, I was running it in Kibana. @TheUknown
– Drubio
2 hours ago





I verified it cause it responded to all my other petitions. It was only the reindex the one that was failing. @AshwaniShakya
– Drubio
2 hours ago




1 Answer
1



EDIT: I have just tested it again and it happens something strange. The index is being reindexed, but the error message is still being displayed. Any explanation about that? The message is confusing cause it seems to have failed, but it should be running still...



This is because of the socket read timeout, you can read more here



By default, the read times out in 30s while the re-indexing is still in progress. You can increase the timeout to avoid this error.



Also, even if it times out, you can use below command to check current progress


GET _tasks?detailed=true&actions=*reindex






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard