I myself found the answer to part of the question. I managed to get it on the command line.
curl -XGET my_server:9200/idx_occurrence/Occurrence/_search?pretty=true -d '{ "query": { "query_string" :{"fields" : ["kingdom_interpreted"], "query": "Plantae" } } }'
using PHP to execute the (correct) cURL request simply sends back an empty string. There are no errors in PHP logs.
$url='curl -XGET http://<my_url>:9200/idx_occurrence/Occurrence/_search?pretty=true -d \'{ "query": { "query_string" :{ "fields" : ["kingdom_interpreted"], "query": "Plantae" } } }\''; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); ob_start(); curl_exec ($ch); curl_close ($ch); $data = ob_get_contents(); ob_end_clean(); var_dump($data);
Again, if instead of $ url I am sending this url my_url: 9200 / idx_occurrence / Occurrence / _search? q = kingdom_interpreted: Plantae
It works. Why?
user1249791
source share