コード例 #1
0
ファイル: MappingManager.php プロジェクト: revinate/search
 /**
  * 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.
         }
     }
 }
コード例 #2
0
ファイル: SearchManager.php プロジェクト: revinate/search
 /**
  * Generate filter used by generateQueryBy()
  *
  * @param array $criteria
  *
  * @return BoolAnd
  * @throws InvalidArgumentException
  * @throws \Exception
  */
 public function generateFilterBy(array $criteria)
 {
     return $this->client->generateFilterBy($criteria);
 }