本文整理匯總了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);
}