Max aggregation in transforms


In transform, i have created one max field with the below script, but when the documents are not present it is returning as null value and getting fail.
can you please suggest how to handle it.
"MaxHandlingDuration" :{
"max": {
"script": {
"lang": "painless",
"source": """
if(doc['CallActionName'].size() > 0 ){
if(doc['CallActionName'].value=='CallHandlingComplete' )

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