jolicode / elastically

🔍 JoliCode's Elastica wrapper to bootstrap Elasticsearch PHP integrations
MIT License
248 stars 39 forks source link

Add a way to force the refresh on the Indexer bulk request #31

Open damienalexandre opened 4 years ago

damienalexandre commented 4 years ago

Being able to set $bulk->setRequestParam('refresh', 'wait_for'); could be useful.

Same goes for pipeline.

ThibautSF commented 4 years ago

Being able to set $bulk->setRequestParam('refresh', 'wait_for'); could be useful.

Same goes for pipeline.

In fact I would extend to: being able to set any requestParam -> https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html#docs-bulk-api-query-params

Very basic implementation idea : Maybe Indexer->setBulkRequestsParam(string $paramName, $value) Each value stored in an associative array (like Elastica Bulk->setRequestParam()) and each time getCurrentBulk instantiate a new Bulk object, the array is read to transfer the parameters to the new Bulk