<?php
$data_string = '{
"query": {
"match" : {
"message" : "test"
}
}
}';
$ch = curl_init('http://localhost:9200/xenforo_database_name/_search?pretty=true');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string))
);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string );
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
$result = curl_exec($ch);
echo $result;
?>