/** * @param array $dataSet * * @throws \Spryker\Zed\Collector\Business\Exporter\Exception\InvalidDataSetException * * @return bool */ public function delete(array $dataSet) { if ($this->hasIntegerKeys($dataSet)) { throw new InvalidDataSetException(); } try { $documents = []; foreach ($dataSet as $key => $value) { $documents[] = $this->index->getType($this->type)->getDocument($key); } $response = $this->index->deleteDocuments($documents); $this->index->flush(true); return $response->isOk(); } catch (\Exception $exception) { return true; } }