Пример #1
0
 /**
  * Returns all index settings
  *
  * @return array Index settings
  */
 public function getSettings()
 {
     // TODO Update as soon as new API is implmented
     $cluster = new Elastica_Cluster($this->_index->getClient());
     $state = $cluster->getState();
     return $state['metadata']['indices'][$this->_index->getName()]['settings'];
 }
Пример #2
0
 public function testGetNodeNames()
 {
     $client = new Elastica_Client();
     $cluster = new Elastica_Cluster($client);
     $names = $cluster->getNodeNames();
     $this->assertInternalType('array', $names);
     $this->assertGreaterThan(0, count($names));
 }
Пример #3
0
 /**
  * Checks if the given index is already created
  *
  * @return bool True if index exists
  */
 public function exists()
 {
     $cluster = new Elastica_Cluster($this->getClient());
     return in_array($this->getName(), $cluster->getIndexNames());
 }