Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

Organizational Research By

Surprising Reserch Topic

Elastic Search using PHP not working


I am a very beginner of Elastic search.
and I want to create a node in php using Curl

curl -XPUT "http://localhost:9200/movies/movie/1" -d'
{
    "title": "The Godfather",
    "year": 1972
}'

WITHOUT USING any open source like elastica i want to implement the above CURL,
I tried this-


$url='curl -XPUT "http://localhost:9200/movies/movie/1" -d\' { "title": "The Godfather","year": 1972}\'';

$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);
?>

asked Apr 15, 2015 in codeinither by rajesh
0 votes
83 views



Related Hot Questions



Government Jobs Opening


...