Elasticsearch - How to update/index multiple documents

I'm faced with a situation where I need to build an index of about 500,000 records. I'm using the official php client and wondering what should be the right way to do the update.

The only solution I can think of is to have a foreach loop and call $response = $client->index($params); in it.

But is that the right way to go about it or there's something I'm missing out on? Would really appreciate your responses. Thanks!

You should use the Bulk API for this.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.