PHP code example of hedeqiang / elasticsearch

1. Go to this page and download the library: Download hedeqiang/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/ */

    

hedeqiang / elasticsearch example snippets


.
.
.
'elasticsearch' => [
    [
        'host'    => env('ES_HOST','localhost'),
        'port'    => env('ES_PORT','9200'),
        'scheme'  => env('ES_SCHEME','http'),
        'user'    => env('ES_USERNAME',null),
        'pass'    => env('ES_PASSWORD','null'),
    ],
],

return app('es')->info();

use Hedeqiang\ElasticSearch\Facades\Elastic;

return Elastic::es()->info();