Answer the question
In order to leave comments, you need to log in
How to write a script in elasticsearch?
Good afternoon.
I need to do a search using a mathematical formula.
here is the sql that needs to be implemented on elasticsearch
SELECT id,`latitude`,`longitude`, (((ACOS(SIN(44.4609123 * PI() / 180) * SIN(`latitude` * PI() / 180) +
COS(44.4609123 * PI() / 180) * COS(`latitude` * PI() / 180) * COS((34.1463064 - `longitude`) *
PI() / 180)) * 180 / PI()) * 60 * 1.1515))/0.62137 AS distance
FROM ` mapCordinateTest`
HAVING distance<= '60' ORDER BY distance ASC;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question