How to push large excel data to elasticsearch using bulk API

Is it somehow the same thread as:

?

I'd suggest keeping the discussion in only one thread instead so we can follow or at least link to the previous post if this one is closed.

If it's totally something different then having a new question is fine.

BTW could you please format your code using </> icon as explained in this guide. It will make your post more readable.

Or use markdown style like:

```
CODE
```

May be 50000 items is too much per bulk operation?
You can try to run a bulk API call every 5000 docs for example.

Have a look at https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-document-bulk.html#java-rest-high-document-bulk-processor

This will simplify a lot your code IMO.

BTW system.out might slow down a lot your code.