Execute a bulk and return the execution response.
public executeBulk ( Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface $bulk ) : Smile\ElasticsuiteCore\Api\Index\Bulk\BulkResponseInterface | ||
$bulk | Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface | Bulk to be executed. |
리턴 | Smile\ElasticsuiteCore\Api\Index\Bulk\BulkResponseInterface |
/** * {@inheritDoc} */ public function deleteIndex($dimensions, \Traversable $documents) { foreach ($dimensions as $dimension) { $storeId = $dimension->getValue(); $index = $this->indexOperation->getIndexByName($this->indexName, $storeId); $type = $index->getType($this->typeName); foreach ($this->batch->getItems($documents, $this->batchSize) as $batchDocuments) { $bulk = $this->indexOperation->createBulk()->deleteDocuments($index, $type, $batchDocuments); $this->indexOperation->executeBulk($bulk); } $this->indexOperation->refreshIndex($index); } return $this; }