Heyday\Elastica\ElasticaService::batch
Pause all add / remove operations, batching these at the completion of a user-provided callback.
For example, you might call batch with a closure that initiates ->index() on 20 records. On the conclusion of this closure, those 20 updates will be batched together into a single update
Signature
public function batch(callable
$callback,
[integer&
$documentsProcessed = 0] )
Parameters
$callback
— callable- Callback within which to batch updates
$documentsProcessed
— integer- Number of documents processed during this batch
Returns
- mixed
- result of $callback