I got the json values in elasticsearch by using the below code:
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);
I tried to get all the json values from postman api to elasticsearch using PHP, can you all please guide me to achieve the same.