Elasticsearch painless script php


(Svarup) #1

Elasticsearch update by query can't update field with null value

$a = NULL;
$b = NULL;

'script' => [
'inline' => "ctx._source.a = $a; ctx._source.b = $b;",
'lang' => 'painless',
],

give me compile error "script_stack":["... x._source.a = ; ctx._source.b ..." invalid sequence of tokens near [';']


(Svarup) #2

it's work if we change $a and $b variable as below

$a = 'null';
$b = 'null';


(system) #3

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