PHP code example of xiaosongshu / elasticsearch
1. Go to this page and download the library: Download xiaosongshu/elasticsearch library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
xiaosongshu / elasticsearch example snippets
return [
/** 节点列表 */
'nodes' => ['127.0.0.1:9200'],
/** 用户名 */
'username'=>'',
/** 密码 */
'password'=>'',
];
$client = new \Xiaosongshu\Elasticsearch\ESClient();