/** * Delete all indices */ public function deleteAllIndices() { /** @var ClassMetadata[] $metadatas */ $metadatas = $this->sm->getMetadataFactory()->getAllMetadata(); foreach ($metadatas as $metadata) { try { $this->client->deleteIndex($metadata->getIndexForRead()); } catch (ResponseException $e) { if (strpos($e->getResponse()->getError(), 'IndexMissingException') === false) { // The original error from ES is not "IndexMissingException". We shouldn't swallow it. throw $e; } // The index has been deleted already, skip it. } } }
/** * Generate filter used by generateQueryBy() * * @param array $criteria * * @return BoolAnd * @throws InvalidArgumentException * @throws \Exception */ public function generateFilterBy(array $criteria) { return $this->client->generateFilterBy($criteria); }