Php for putScript

how do i setup the params for ES php putScript()?

The following doesn't work.

$params = [
"id"=>"script_name",
"lang"=> "painless",
"body"=> "painless javascript here"
];
$response = $client->putScript($params);

In Kibana: this works:

POST _scripts/script_name
{
"script": {
"lang": "painless",
"source": "painless javascript here"
}
}

Hi,
Does this aid in your putScript discovery? - https://github.com/elastic/elasticsearch-php/issues/686#issuecomment-348212032

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.