PHP code example of kinetis / search-elasticsearch
1. Go to this page and download the library: Download kinetis/search-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/ */
kinetis / search-elasticsearch example snippets
use Kinetis\SearchElasticsearch\ElasticsearchClientFactory;
$client = ElasticsearchClientFactory::fromConfig($config);
$client->index(['index' => 'articles', 'id' => '1', 'body' => ['title' => 'Kinetis']]);
$results = $client->search(['index' => 'articles', 'body' => ['query' => ['match' => ['title' => 'Kinetis']]]]);