How to pass search query to elasticsearch from laravel controller

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);

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.