Hi all,
After the upgrade from version 6 to 7, we are experiencing a new behavior when processing aggregation. Now, whenever the Elastic comes across with a null value in a field while running a Painless script it breaks, by default.
For example, the following simple if/else statement:
if(doc['MY_FIELD'].value <= 9000)
{return 'Less than 9k' }
else if(doc['MY_FIELD'].value > 9000)
{ return ''More than 9k' }
Until version 6, we could run this code without any issue whatsoever. However now, if you try the same thing it fails when Elastic processes a single null value for the field.
"lang" : "painless",
"caused_by" : {
"type" : "illegal_state_exception",
"reason" : "A document doesn't have a value for a field! Use doc[<field>].size()==0 to check if a document is missing a field!"
That makes now mandatory to stuff this "doc[<field>].size()==0
" checking everywhere.
Is that a parameter to shut this new behavior off and resume the previous one?
Thanks