Bulk updates are extremely slow after upgrading to 5.2

The reason why it's slow is probably the following:

As of 5.0.0 the get API will issue a refresh if the requested document has been changed since the last refresh but the change hasn’t been refreshed yet. This will also make all other changes visible immediately. This can have an impact on performance if the same document is updated very frequently using a read modify update pattern since it might create many small segments. This behavior can be disabled by passing realtime=false to the get request.

An update operation is effectively a GET + INSERT.

The solution would be not to frequently update the same documents again and again. If that's a necessity, you should batch these updates on the application level.