C:\Users\Administrator\AppData\Local\Temp\scp55598\home\admin\domains\yp.vn\public_html\apiyp.php
use Elasticsearch\ClientBuilder;
require 'vendor/autoload.php';
$client = ClientBuilder::create()->build();
$params = [
'index' => 'my_index',
'id' => 'my_id',
'body' => ['testField' => 'abc']
];
$response = $client->index($params);
print_r($response);
<?php
// https://yp.vn/apiyp.php?findtext=findtext&longtituide=longtituide&lengtituide=lengtituide&distance=distance
use Elasticsearch\ClientBuilder;
require 'vendor/autoload.php';
$client = ClientBuilder::create()->build();
// $params = [
// 'index' => 'my_index',
// 'id' => 'my_id',
// 'body' => ['testField' => 'abc']
// ];
// $response = $client->index($params);
$params = [
'index' => 'my_index',
'id' => 'my_id'
];
$response = $client->get($params);
print_r($response);
?>