i am working on this one but it is not working , i am using aws elasticsearch 6.2
$hosts=[
'host' => 'localhost(here i am using aws end point)'
];
$client = ClientBuilder::create() ->setHosts($hosts) ->build();
$json = '{
"query" : {
"match" : {
"title" : "phone"
}
}
}';
$params['index'] = 'sainikad';
$params['type'] = 'ads';
$params['body'] = $json;
$results=$client->search($params);