# How to iterate over Geopoints in painless?

**URL:** <https://discuss.elastic.co/t/how-to-iterate-over-geopoints-in-painless/244648>\
**Category:** Elasticsearch\
**Tags:** painless\
**Created:** [August 12, 2020, 1:33am UTC](https://discuss.elastic.co/t/how-to-iterate-over-geopoints-in-painless/244648 "2020-08-12T01:33:22Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![ClubberLang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/clubberlang/32/72169_2.png) [@ClubberLang](https://discuss.elastic.co/u/ClubberLang)\
**Post date:** [August 12, 2020, 9:21am UTC](https://discuss.elastic.co/t/how-to-iterate-over-geopoints-in-painless/244648/5 "2020-08-12T09:21:28Z")

</div>

Thanks for your suggestion,

Such request exist since a long time, see:

> <https://github.com/elastic/elasticsearch/issues/25796>
>
> It will be really confortable to allow call to arcDistance from GeoPoint. Indeed… actually we can only call them from GeoPoints (and that will use only the first point).

In the current situation, the script is necessary... it allows me to generate fields for debugging my DSL ! I will remove it in production.

It is to debug another query, that use distance\_feature (That I can't make it work):

> [@Multiply scores between 'distance\_feature' and 'dismax'?](https://discuss.elastic.co/t/multiply-scores-between-distance-feature-and-dismax/244638):
>
> Hi, Imagine I have 3 queries: "distance\_feature": { ... time... } "distance\_feature": { ... location... } "dis\_max" : { ... } Currently, to combine it I do this: "query" : { "bool" : { "must" : ["distance\_feature": { ... time... }, "distance\_feature": { ... location... }, "dis\_max" : { ... },] } } The problem is that the score of computes as a sum, and I'm looking for a way to "multiply" instead. I have try with function score, but I can't put them there, right ? Do y…

My sorting is based on multiples criterions... not only the distance.

But anyway, I suspect that I should use it in my query... (I don't like this, but maybe there are no other choices).

---

_[View the full topic](https://discuss.elastic.co/t/how-to-iterate-over-geopoints-in-painless/244648)._
