diff --git a/src/Engines/TypesenseEngine.php b/src/Engines/TypesenseEngine.php index 76c30e9..aa54e5d 100644 --- a/src/Engines/TypesenseEngine.php +++ b/src/Engines/TypesenseEngine.php @@ -913,4 +913,17 @@ public function deleteIndex($name): array { return $this->typesense->deleteCollection($name); } + + /** + * Delete all search indexes. + * + * @return void + */ + public function deleteAllIndexes() { + $indexes = $this->typesense->getClient()->getCollections()->retrieve(); + + foreach($indexes as $index) { + $this->typesense->deleteCollection($index['name']); + } + } }