It should be possible to provide Bulk Action on Connection and Engine.
$engine->bulk(string $index, \Generator $saveDocuments, \Generator $deleteDocuments, bulkSize: 100);
// and
$indexer->bulk(Index $index, \Generator $saveDocuments, \Generator $deleteDocuments, bulkSize: 100);
Engine not supporting bulk action can fallback to basic save and delete methods.
The documents should be able to be aryor \Generator for performance.
A BulkableIndexerInterface should be added so the fallback to the save/delete can be part of the Engine and not every adapter itself need to implement it.
Bulk Action make maybe sense in case of:
Implementing of Reindex Providers #16
It should be possible to provide Bulk Action on Connection and Engine.
Engine not supporting bulk action can fallback to basic save and delete methods.
The
documentsshould be able to be aryor \Generator for performance.A
BulkableIndexerInterfaceshould be added so the fallback to the save/delete can be part of the Engine and not every adapter itself need to implement it.Bulk Action make maybe sense in case of:
Implementing of Reindex Providers #16