Hi,
I am using Elasticsearch 7.8.0. I am trying to copy documents from one index to another using reindex API. I tried 2 cases.
Case 1. Only source index is present in the Elasticsearch cluster. Destination index is not pre-created and it got created by reindex API. In this case the documents got successfully copied into destination index.
Case 2. Both source and destination index(pre-created) are present in ES cluster. Now when I run reindex API, even-though the reindex ran without any errors, the documents did not get copied into destination index. After 5-10 minutes all the documents got copied into destination index. I have tried the same command with wait_for_completion=true. But the curl command is coming out and it is not waiting for the process to get completed. I can see that the destination index still has document count 0. After 5-10 minutes the document count got increased.
Note - Source Index size is in kb and it has less documents. But still it is taking 5-10 minutes to copy when I try reindex API as mentioned in Case 2. If I try reindex as mentioned in Case 1 immediately documents got copied into destination index.
Below is the command tried and its output-
curl -X POST "ES-IP:9200/_reindex?wait_for_completion=true" -H 'Content-Type: application/json' -d'
{
"source": {
"index": "index-1
},
"dest": {
"index": "index-2",
}
}
'
{"took":224,"timed_out":false,"total":27,"updated":0,"created":27,"deleted":0,"batches":1,"version_conflicts":0,"noops":0,"retries":{"bulk":0,"search":0},"throttled_millis":0,"requests_per_second":-1.0,"throttled_until_millis":0,"failures":}
Can you please tell me why is the Case 2 not working as expected?