# Elastic search geo\_distance query results not accurate

**URL:** <https://discuss.elastic.co/t/elastic-search-geo-distance-query-results-not-accurate/97808>\
**Category:** Elasticsearch\
**Created:** [August 21, 2017, 5:52pm UTC](https://discuss.elastic.co/t/elastic-search-geo-distance-query-results-not-accurate/97808 "2017-08-21T17:52:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shantanu\_Deshmukh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shantanu_deshmukh/32/19885_2.png) [@Shantanu\_Deshmukh](https://discuss.elastic.co/u/Shantanu_Deshmukh)\
**Post date:** [August 21, 2017, 5:52pm UTC](https://discuss.elastic.co/t/elastic-search-geo-distance-query-results-not-accurate/97808/1 "2017-08-21T17:52:43Z")

</div>

I am running a geo\_distance query on an index containing about 20k documents. Mapping for this index has a geo\_point type field. Results are coming out inaccurate. When I put distance as 1Km I am getting documents which are 4km away. What is wrong here? Please help.  
Query:  
GET branch-master-v2/\_search?size=500  
{  
"query": {  
"bool": {  
"must": {  
"match\_all" : {}  
},

```
            "filter": {
                "geo_distance": {
                    "distance": "1km",
                    "distance_type": "arc", 
                    "LOCATION": {
                        "lat": 72.8365072,
                        "lon": 19.0577397
                    },
                    "unit": "km"
                }
            }
        }
    },
    "script_fields":{
        "distance" : {
                "script":"doc['LOCATION'].arcDistance(72.7967221,19.1020398)"
        }
    }
}

```

Output

```
"hits": [
      {
        "_index": "branch-master-v2",
        "_type": "master",
        "_id": "4447",
        "_score": 1,
        "fields": {
          "distance": [
            4602.10747146603
          ]
        }
      },
      {
        "_index": "branch-master-v2",
        "_type": "master",
        "_id": "544",
        "_score": 1,
        "fields": {
          "distance": [
            4645.636614519423
          ]
        }
      },
      {
        "_index": "branch-master-v2",
        "_type": "master",
        "_id": "5081",
        "_score": 1,
        "fields": {
          "distance": [
            4623.3935976666435
          ]
        }
      },
      {
        "_index": "branch-master-v2",
        "_type": "master",
        "_id": "15172",
        "_score": 1,
        "fields": {
          "distance": [
            5170.873376615598
          ]
        }
      },
      {
        "_index": "branch-master-v2",
        "_type": "master",
        "_id": "1179",
        "_score": 1,
        "fields": {
          "distance": [
            4518.371061139671
          ]
        }
      },
      {
        "_index": "branch-master-v2",
        "_type": "master",
        "_id": "3758",
        "_score": 1,
        "fields": {
          "distance": [
            5485.6415697650555
          ]
        }
      }
    ]

```

P.s: ElasticSearch version is 5.1.2

---

<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:** [September 18, 2017, 5:52pm UTC](https://discuss.elastic.co/t/elastic-search-geo-distance-query-results-not-accurate/97808/2 "2017-09-18T17:52:45Z")

</div>

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