I am dividing two doc_counts from an aggregate to produce a percentage and compare it to a percentage. Does integer division in painless produce a float or another integer? I'm using the ctx.vars to get it into a log message to try to debug. Does the log message go to the elastic log or somewhere else?
"inline": "if ((ctx.payload.current_poll.aggregations.fandp.buckets.0.doc_count > 0) && (ctx.payload.current_poll.aggregations.fandp.buckets.1.doc_count > 0)) { ctx.vars.xx = (ctx.payload.current_poll.aggregations.fandp.buckets.1.doc_count / (ctx.payload.current_poll.aggregations.fandp.buckets.0.doc_count + ctx.payload.current_poll.aggregations.fandp.buckets.1.doc_count)); return ctx.vars.xxx > ctx.payload.week_poll.aggregations.avg_fail; } else { return false; }"