PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?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);
Show:  
Copy Clear