Does the new Reindex API always reindex to a single shard?

I used the new reindex API recently and noticed it reduced the old index of 5 primary shards to a new index with only 1 primary shard.

Is the idea that we should typically create the new index with n shards first before reindexing to it?

It behaves just like a bulk request in that it'll make the index if it doesn't exist using the default settings. Did you add an index template that defaults you to 1 shard?

Yeah. I didn't want to cram the index creation API inside of reindex when you can just call the index creation API. It seemed like more complexity than was worth it. The real benefit of reindex is that you don't have to manage the scroll context and the looping. It makes "copy one index into another" a thing even I can do in a shell script.

That makes a lot of sense to have the reindex API just do the reindexing and no more.

I wasn't sure at first why it didn't create the default 5 shards, but now I see that I did apply an index template earlier with only one shard.

Thanks.

Awesome! I'm glad it wasn't something really really sneaky. Just normal, somewhat sneaky templates.

I'm glad I could help and sorry for the confusion.