I was having a problem populating the index with about 100.000 records from a db table mapped as doctrine entities. I was getting a variable number of indexed documents (between 60.000 and 90.000) but after some tests I could see that the provider was sending 100.000 documents to the ES server.

The problem was that some rows were being sent twice, while others were not being sent.

Looking for the problem I saw that to get the table slice, the bundle was using a select statement with limit and offset but without order. With this params, major DB systems cannot guarantee the order between different SQL requests, so some rows were being selected twice. The populating process terminates when the table count is reached, so for each document sent twice, another one is not sent to the ES server.