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