D
D
Drum Kit2015-12-14 09:29:48
elasticsearch
Drum Kit, 2015-12-14 09:29:48

Is it possible to use sin or cos in Elasticsearch?

I need to write such sql in elasticsearch
how can i implement such a search ?
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

1 answer(s)
Z
Zakharov Alexander, 2015-12-14
@AlexZaharow

Your request is not complicated, but you have two options:
1. just select the required data without processing and process it already on the client.
2. To process the selected data, use a script (by default, scripting is not enabled at all, but after it is enabled, there is Groovy. javascript must be installed as a separate plugin). More details: https://www.elastic.co/guide/en/elasticsearch/refe...
PS
I rarely make requests, so right off the bat, and even without a diagram, I can’t suggest anything yet.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question