When I try to run this script it tells me 5 shards of 240 failed.
{
"script": {
"inline": "float u_x = Math.abs(doc['x'].value-doc['x'].value)-doc['x'].value;float u_y = Math.abs(doc['y'].value-doc['y'].value)-doc['y'].value;float v_x = Math.abs(doc['x'].value-doc['x'].value)-doc['x'].value;float v_y = Math.abs(doc['y'].value-doc['y'].value)-doc['y'].value;return (180/3.14159265359)*Math.acos((u_x*v_x+u_y*v_y)/(Math.sqrt(u_x*u_x+u_y*u_y)*Math.sqrt(v_x*v_x+v_y*v_y)));",
"lang": "painless"
}
}