Hi, how can I avoid this?
GET /repository/_search
{
"query": {
"script": {
"script": {
"source": "6371 * Math.acos( Math.cos((Math.PI / 180)*(39.9874542)) * Math.cos((Math.PI / 180)*(doc['destinationY'].value)) * Math.cos((Math.PI / 180)*(doc['destinationX'].value) - (Math.PI / 180)*(-0.0830824)) + Math.sin((Math.PI / 180)*(39.9874542)) * Math.sin((Math.PI / 180)*(doc['destinationY'].value))) < 12",
"lang": "painless"
}
}
},
"sort": {
"_script": {
"type": "number",
"script": {
"lang": "painless",
"source": "6371 * Math.acos( Math.cos((Math.PI / 180)*(39.9874542)) * Math.cos((Math.PI / 180)*(doc['destinationY'].value)) * Math.cos((Math.PI / 180)*(doc['destinationX'].value) - (Math.PI / 180)*(-0.0830824)) + Math.sin((Math.PI / 180)*(39.9874542)) * Math.sin((Math.PI / 180)*(doc['destinationY'].value)))"
},
"order": "asc"
}
}
}
Thanks.