本文整理匯總了PHP中Elasticsearch\Client::newBuilder方法的典型用法代碼示例。如果您正苦於以下問題:PHP Client::newBuilder方法的具體用法?PHP Client::newBuilder怎麽用?PHP Client::newBuilder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Elasticsearch\Client
的用法示例。
在下文中一共展示了Client::newBuilder方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: classSetUp
protected function classSetUp()
{
$this->client = $client = Client::newBuilder()->setHosts(['127.0.0.1:9200'])->build();
$this->setupClient = $client = Client::newBuilder()->setHosts(['127.0.0.1:9200'])->build();
$indexParams['index'] = 'benchmarking_index';
$indexParams['body']['test']['_all']['enabled'] = false;
$indexParams['body']['test']['properties']['testField'] = array('type' => 'string', 'store' => 'no', 'index' => 'no');
$this->setupClient->indices()->create($indexParams);
$this->document = array();
$this->document['body'] = array('testField' => 'abc');
$this->document['index'] = 'benchmarking_index';
$this->document['type'] = 'test';
$this->mediumDocument = array();
$this->mediumDocument['body']['testField'] = str_repeat('a', 1000);
$this->mediumDocument['index'] = 'benchmarking_index';
$this->mediumDocument['type'] = 'test';
$this->largeDocument = array();
$this->largeDocument['body']['testField'] = str_repeat('a', 5000);
$this->largeDocument['index'] = 'benchmarking_index';
$this->largeDocument['type'] = 'test';
}