# GPS search speed optimization

**URL:** <https://discuss.elastic.co/t/gps-search-speed-optimization/40091>\
**Category:** Elasticsearch\
**Created:** [January 26, 2016, 6:56am UTC](https://discuss.elastic.co/t/gps-search-speed-optimization/40091 "2016-01-26T06:56:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ycunc](https://avatars.discourse-cdn.com/v4/letter/y/dec6dc/32.png) [@ycunc](https://discuss.elastic.co/u/ycunc)\
**Post date:** [January 26, 2016, 6:56am UTC](https://discuss.elastic.co/t/gps-search-speed-optimization/40091/1 "2016-01-26T06:56:04Z")

</div>

Hi All

I am writing a simple GPS search query, like following

"query": {  
"filtered": {  
"filter": {  
"geo\_distance": {  
"distance": "1km",  
"distance\_type": "plane",  
"location": {  
"lat": 40.111,  
"lon": -73.322  
}  
}  
}  
}  
},

It seems the search speed for this filter is much slower than I have expected for this simple operation. For a 1.5M dataset, it takes about 200-300 ms to finish one GPS query. Is there any other thing we can do to make the search faster? The results do not need to be super accurate, so certain approximation is acceptable. Thanks!

---

<div class="post-metadata">

**Author:** ![ebuildy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ebuildy/32/6070_2.png) [@ebuildy](https://discuss.elastic.co/u/ebuildy)\
**Post date:** [January 26, 2016, 9:25am UTC](https://discuss.elastic.co/t/gps-search-speed-optimization/40091/2 "2016-01-26T09:25:14Z")

</div>

You could try geo-hash, read: [https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geohash-cell-query.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geohash-cell-query.html)

---

<div class="post-metadata">

**Author:** ![whybangbang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/whybangbang/32/7116_2.png) [@whybangbang](https://discuss.elastic.co/u/whybangbang)\
**Post date:** [January 26, 2016, 9:32am UTC](https://discuss.elastic.co/t/gps-search-speed-optimization/40091/3 "2016-01-26T09:32:31Z")

</div>

geo\_distance is precision high and calculate slow,es have box filter hash cell filter and so on ,i suggest you try these

---

<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:** [July 5, 2017, 11:21pm UTC](https://discuss.elastic.co/t/gps-search-speed-optimization/40091/4 "2017-07-05T23:21:39Z")

</div>


