本文整理汇总了PHP中Elasticsearch\Client::info方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::info方法的具体用法?PHP Client::info怎么用?PHP Client::info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Elasticsearch\Client
的用法示例。
在下文中一共展示了Client::info方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testInfo
public function testInfo()
{
/** @var \Iwai\Elasticsearch\FutureData $info */
$info = $this->client->info();
$response = $info->wait();
$this->assertNotEmpty($response);
$this->assertEquals('array', gettype($response));
}
示例2: getStatus
/**
* {@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;
}
示例3: getVersionNumber
/**
* Returns Elasticsearch version number.
*
* @return string
*/
public function getVersionNumber()
{
return $this->client->info()['version']['number'];
}
示例4: __construct
public function __construct($config, Client $client)
{
$this->index = $config['db_name'];
$this->conn = $client;
$this->esMajorVersion = substr($client->info()['version']['number'], 0, 1);
}