PHP code example of elastification / php-client-bundle
1. Go to this page and download the library: Download elastification/php-client-bundle 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/ */
elastification / php-client-bundle example snippets
/** @var Client $client */
$client = $this->get('elastification_php_client');
$request = new SearchRequest('my-index', 'my-type', new NativeJsonSerializer());
$response = $client->send($request);
//get the raw deserialized data
var_dump($response->getData()->getGatewayValue());
//for grabbing into the result do: $response->getData()['hits']