本文整理汇总了PHP中Elastica\Index::getStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP Index::getStatus方法的具体用法?PHP Index::getStatus怎么用?PHP Index::getStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Elastica\Index
的用法示例。
在下文中一共展示了Index::getStatus方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testInvalidElasticRequest
/**
* @expectedException \Elastica\Exception\ResponseException
*/
public function testInvalidElasticRequest()
{
$connection = new Connection();
$connection->setHost('localhost');
$connection->setPort(9500);
$connection->setTransport('Thrift');
$client = new Client();
$client->addConnection($connection);
$index = new Index($client, 'missing_index');
$index->getStatus();
}
示例2: testInvalidElasticRequest
/**
* @group functional
* @expectedException \Elastica\Exception\ResponseException
*/
public function testInvalidElasticRequest()
{
$this->_checkPlugin();
$connection = new Connection();
$connection->setHost($this->_getHost());
$connection->setPort(9500);
$connection->setTransport('Thrift');
$client = $this->_getClient();
$client->addConnection($connection);
$index = new Index($client, 'missing_index');
$index->getStatus();
}
示例3: _waitForAllocation
protected function _waitForAllocation(Index $index)
{
do {
$settings = $index->getStatus()->get();
$allocated = true;
foreach ($settings['shards'] as $shard) {
if ($shard[0]['routing']['state'] != 'STARTED') {
$allocated = false;
}
}
} while (!$allocated);
}