Does indices()->refresh() wait for the completion of Bulk API?

In order to populate an index I have disabled its refresh_interval and I'm using the Bulk API for inserting.

The problem is I'm doing this in chunks of data and I need that after each chunk all the information is available for search.

data1: Bulk Insert
$client->indices()->refresh() // Elasticsearch-PHP API call
data2: Bulk Insert

Does the refresh operation wait for all the bulk operations to end ? If not, is there another way to achieve this ?

I know ?refresh=wait_for with each bulk API call does this, but I feel it defies the use of the Bulk API.

That'd be the best way given what you are doing here I think.

1 Like

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