本文整理匯總了PHP中Elasticsearch\ClientBuilder::singleHandler方法的典型用法代碼示例。如果您正苦於以下問題:PHP ClientBuilder::singleHandler方法的具體用法?PHP ClientBuilder::singleHandler怎麽用?PHP ClientBuilder::singleHandler使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Elasticsearch\ClientBuilder
的用法示例。
在下文中一共展示了ClientBuilder::singleHandler方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
<?php
return ['hosts' => ['localhost:9200'], 'retries' => 2, 'handler' => \Elasticsearch\ClientBuilder::singleHandler()];
示例2: testFromConfig
public function testFromConfig()
{
$params = ['hosts' => ['localhost:9200'], 'retries' => 2, 'handler' => ClientBuilder::singleHandler()];
$client = ClientBuilder::fromConfig($params);
}
示例3: _initializeClient
/**
* Create an elasticsearch client
*/
private function _initializeClient()
{
$params = ['hosts' => [getenv('ELASTICSEARCH_PORT_9200_TCP_ADDR') . ':' . getenv('ELASTICSEARCH_PORT_9200_TCP_PORT')], 'retries' => 2, 'handler' => ClientBuilder::singleHandler()];
$this->elasticsearch_client = ClientBuilder::fromConfig($params, true);
}