public function testInfo()
 {
     /** @var \Iwai\Elasticsearch\FutureData $info */
     $info = $this->client->info();
     $response = $info->wait();
     $this->assertNotEmpty($response);
     $this->assertEquals('array', gettype($response));
 }
 /**
  * {@inheritdoc}
  */
 public function getStatus()
 {
     $data = $this->client->info();
     $version = $data['version'];
     unset($data['version']);
     foreach ($version as $prop => $value) {
         $data['version:' . $prop] = $value;
     }
     $ret = [];
     foreach ($data as $key => $value) {
         $ret[] = [$key, $value];
     }
     return $ret;
 }
 /**
  * Returns Elasticsearch version number.
  *
  * @return string
  */
 public function getVersionNumber()
 {
     return $this->client->info()['version']['number'];
 }
Example #4
0
 public function __construct($config, Client $client)
 {
     $this->index = $config['db_name'];
     $this->conn = $client;
     $this->esMajorVersion = substr($client->info()['version']['number'], 0, 1);
 }