本文整理汇总了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';
}