get elasticsearch data magento 2
snippet in php

get elasticsearch data magento 2

user9064

 <?php
 //Make sure you have elasticsearch-php package installed before proceeding
 
    use Elasticsearch\ClientBuilder;
    require 'vendor/autoload.php';
    $client = ClientBuilder::create()->build();
    $params = [
    'index' => 'my_index',
    'id'    => 'my_id'
	];
	$response = $client->get($params);
	print_r($response);