I am creating a scripted field 'popular' as the division of two Integer fields as below:
if (doc['age'].value) > 0
doc['popular'].value = doc['o.nbd'].value / doc['age'].value;
doc['popular'].value = -1;
However, after i submitted, Kibana does not load the index anymore. "There are errors in your input". After i delete the script field, it can load back again alright.
I am wondering if I have any errors in my script above?