Can't got actual data size and documents

I was reindexing one index but while using the reindex api the size of the previous index and new index is not same.
source index
GET /_cat/indices/log-test1?v&pretty

health status index     uuid                   pri rep docs.count docs.deleted store.size pri.store.size
green  open   log-test1 2ZSW9EdnT2SJwxSCFmk64g   1   1   20920610            0     16.4gb          8.2gb

destination
GET /_cat/indices/log-test-1-2021.05.22-000001?v&pretty

health status index                       uuid                   pri rep docs.count docs.deleted store.size pri.store.size
green  open   log-test-1-2021.05.22-000001 EBVL_urcSfC6XgnUG0CFNQ   1   1    6772999            0      4.9gb          2.4gb

The command i run

POST _reindex?wait_for_completion=true
{
  "source": {
    "index": "log-test1"
  },
  
  "dest": {
    "index": "log-test-1-2021.05.22-000001"
  }
}

to check its status
GET _tasks?actions=*reindexand the output is

{
  "nodes" : { }
}

Anything in elasticsearch logs?

I'd try also without wait_for_completion.

The document count differs. Did the reindex complete? Are there any differences in mappings, e.g. differences in use of nested mappings or analysers?

1 Like

No but size of the index is different

I had test this on small index size around 2 gb after 5 10 minutes the new index size and documents was same as previous index

You should use this for larger reindex, async task notice the false see here

POST _reindex?wait_for_completion=false

Even if the the index has the exact number of documents the size might be slightly different , because the first index may have had segments merged etc but the should be pretty close.
.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.