# Regarding implementing knn for geo-points

**URL:** <https://discuss.elastic.co/t/regarding-implementing-knn-for-geo-points/304384>\
**Category:** Elasticsearch\
**Created:** [May 10, 2022, 6:47pm UTC](https://discuss.elastic.co/t/regarding-implementing-knn-for-geo-points/304384 "2022-05-10T18:47:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dido](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dido/32/104521_2.png) [@dido](https://discuss.elastic.co/u/dido)\
**Post date:** [May 10, 2022, 6:47pm UTC](https://discuss.elastic.co/t/regarding-implementing-knn-for-geo-points/304384/1 "2022-05-10T18:47:57Z")

</div>

Let's say I have an index of geo-json data of restaurants and another index of geo-json data of pharmacies. If I want to get all pharmacies having restaurant with in 100m, How can I do that. Taking each pharmacies coordinate and looking for restaurants with geo\_distance does not scale and requires a lot processing so not works for real time. I google and it is like nearest neighbors problem. I thought that I can solve the problem using elasticknn plugin and but I dont know how to consider coordinates as vectors. Can anyone please show some angle about this problem?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 7, 2022, 6:48pm UTC](https://discuss.elastic.co/t/regarding-implementing-knn-for-geo-points/304384/2 "2022-06-07T18:48:54Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
