I have the following php curl commands running on the same server where the ES is installed and running on port 9200.
$ch = curl_init('http://localhost:9200/cfaq/_search');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Length: ' . strlen($data_string))
$result = curl_exec($ch);
This curl function is returning the following whatever Search Query i use.
However, when I try same search query on same server using terminal curl command (eg: curl -X POST 'http://localhost:9200/cfaq/_search?q=Job'), I get the desired
results. Here is my configuration on elasticsearch.yml file:
My Elastic search version is 6.5.0
Please let me know if you have any questions.
Can you please let me know what I am doing wrong?