ElasticSearcher\Managers\IndicesManager::delete PHP Method

delete() public method

public delete ( string $indexName )
$indexName string
    public function delete($indexName)
    {
        $index = $this->getRegistered($indexName);
        $params = ['index' => $index->getInternalName()];
        $this->elasticSearcher->getClient()->indices()->delete($params);
    }

Usage Example

 public function testWithPrefixedIndex()
 {
     $booksIndex = new BooksIndex();
     $this->indicesManager->register($booksIndex);
     if ($this->indicesManager->exists('books')) {
         $this->indicesManager->delete('books');
     }
     $this->indicesManager->create('books');
     $this->assertTrue($this->indicesManager->exists('books'));
     $expectedIndex = ['prefix_books' => ['mappings' => $booksIndex->getTypes()]];
     $this->assertEquals($expectedIndex, $this->indicesManager->get('books'));
     $this->indicesManager->delete('books');
     $this->assertFalse($this->indicesManager->exists('books'));
 }
All Usage Examples Of ElasticSearcher\Managers\IndicesManager::delete