Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
$param = '{
"size": 0,
"aggs":{
"max_id":{
"max": {
"field": "user_id"
}
}
}
}';
$header = array("content-type: application/json; charset=UTF-8");
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "http://" . "172.17.115.16" . ":9200/index_users_thor/_search");
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_POSTFIELDS, $param);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_USERPWD, "elastic" . ":" . "123456789");
$res = curl_exec($curl);
curl_close($curl);
$resJSON = json_decode($res);