public function setUp()
 {
     parent::setUp();
     $this->clusterMock = $this->getMockBuilder(ClusterNamespace::class)->disableOriginalConstructor()->getMock();
     $this->clientMock = $this->getMockBuilder(Client::class)->disableOriginalConstructor()->getMock();
     $this->getElasticSearcher()->setClient($this->clientMock);
 }
 public function setUp()
 {
     parent::setUp();
     // Create our example index.
     $indicesManager = $this->getElasticSearcher()->indicesManager();
     $indicesManager->register(new MoviesIndex());
     $this->documentsManager = $this->getElasticSearcher()->documentsManager();
 }
 public function setUp()
 {
     parent::setUp();
     // Create our example index.
     $this->indicesManager = $this->getElasticSearcher()->indicesManager();
     $this->indicesManager->register(new AuthorsIndex());
     if ($this->indicesManager->exists('authors')) {
         $this->indicesManager->delete('authors');
     }
 }
Esempio n. 4
0
 public function setUp()
 {
     parent::setUp();
     // Create our example index.
     $indicesManager = $this->getElasticSearcher()->indicesManager();
     $indicesManager->register(new MoviesIndex());
     if ($indicesManager->exists('movies')) {
         $indicesManager->delete('movies');
     }
     $indicesManager->create('movies');
     // Index some test data.
     $documentsManager = $this->getElasticSearcher()->documentsManager();
     $documentsManager->bulkIndex('movies', 'movies', [['id' => 1, 'name' => 'Fury', 'year' => 2014], ['id' => 2, 'name' => 'Interstellar', 'year' => 2014], ['id' => 3, 'name' => 'Hercules', 'year' => 2014]]);
 }