create() public method

public create ( string $indexName )
$indexName string
コード例 #1
0
 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'));
 }
コード例 #2
0
 public function testDeleting()
 {
     $this->indicesManager->create('authors');
     $this->indicesManager->delete('authors');
     $this->assertFalse($this->indicesManager->exists('authors'));
 }