$word = $_GET['search'];
$json = json_encode('{"query":{"match":{"name":"'.$word.'"}}}');
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://10.128.0.2:9200/testers/test/_search' . urlencode($json));
$resp = curl_exec($curl);
$word is filled from the URL and this is working normally. $resp isn't coming back with any value. 'name' is the name of elasticsearch field.
I am using PHP to run this curl request as per elasticserch except all in one URL. Are there any better ways to do this from PHP code?