PHP code example of keboola / elasticsearch-dsl
1. Go to this page and download the library: Download keboola/elasticsearch-dsl 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/ */
keboola / elasticsearch-dsl example snippets
ient = ClientBuilder::create()->build(); //elasticsearch-php client
$matchAll = new ONGR\ElasticsearchDSL\Query\MatchAllQuery();
$search = new ONGR\ElasticsearchDSL\Search();
$search->addQuery($matchAll);
$params = [
'index' => 'your_index',
'body' => $search->toArray(),
];
$results = $client->search($params);