PHP code example of xmarcos / elasticsearch-service-provider

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

    

xmarcos / elasticsearch-service-provider example snippets


use Silex\Application;
use xmarcos\Silex\ElasticsearchServiceProvider

$app = new Application();
$app->register(new ElasticsearchServiceProvider(), [
    'elasticsearch.params' => [
        'hosts' => [
            '127.0.0.1:9200'
        ],
        'logging' => false
    ]
]);

$app['elasticsearch']->ping();