Searchkick: Net::ReadTimeout

I have a Ruby on Rails application with searchkick gem. I recently upgraded my elasticsearch from 1.8 to 2.0 (same with 2.2) and problems have started since that time. Before it worked like a charm.

When I try to reindex products (40k), I get the Net::ReadTimeout error after 1000 products are reindexed (the batch_size is set to 1000 by default).

I tried to set batch_size for searchkick to 1, 100, 200, and even then I get the Net::ReadTimeout error. When it was set to 1, it reindexed almost 20k products, if 100, only 100, if 200 only 200 products when it threw that error.

Do you know why this error occurs and how to avoid it? I have tried so many things (increase timeout from 1 to 10 minutes on the server, delete indexes, set the batch_size many times..) and nothing helped.

I have spent on this already few days and am totally stuck, will appreciate any ideas or help.

Thanks a lot for your time, Miroslav