testing if terms_stats field can be function
refactor the esquery code
move maths
move maths
fixes
Generates alerts