# Driving Distance Sort

**URL:** <https://discuss.elastic.co/t/driving-distance-sort/104637>\
**Category:** Elasticsearch\
**Created:** [October 20, 2017, 2:58am UTC](https://discuss.elastic.co/t/driving-distance-sort/104637 "2017-10-20T02:58:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulavijit](https://avatars.discourse-cdn.com/v4/letter/p/858c86/32.png) [@paulavijit](https://discuss.elastic.co/u/paulavijit)\
**Post date:** [October 20, 2017, 2:58am UTC](https://discuss.elastic.co/t/driving-distance-sort/104637/1 "2017-10-20T02:58:33Z")

</div>

Is there way to sort by driving distance instead of the crow distance and also display the driving distance.

By driving distance I mean the distance between two points as shown in Google Maps, instead of distance between two points when a crow flies between them.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 20, 2017, 7:05am UTC](https://discuss.elastic.co/t/driving-distance-sort/104637/2 "2017-10-20T07:05:54Z")

</div>

Elasticsearch does not know what a road is. So it can't do that OOTB.

I know that some companies are using elasticsearch to compute that but it requires a lot a preparation first and then may be more than one request.  
May be you need to store something like paths and distances between major cities or something like this and then use that.

Or may be use in addition to elasticsearch something like Neo4J and store all the roads, paths between cities? And combine search for closest point in elasticsearch with resolve the shortest path in Neo4J?

---

<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:** [November 17, 2017, 7:06am UTC](https://discuss.elastic.co/t/driving-distance-sort/104637/3 "2017-11-17T07:06:01Z")

</div>

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