# ElasticSearch and geo\_point not working as I expect. What I'm doing wrong?

**URL:** <https://discuss.elastic.co/t/elasticsearch-and-geo-point-not-working-as-i-expect-what-im-doing-wrong/67487>\
**Category:** Elasticsearch\
**Created:** [November 29, 2016, 1:41pm UTC](https://discuss.elastic.co/t/elasticsearch-and-geo-point-not-working-as-i-expect-what-im-doing-wrong/67487 "2016-11-29T13:41:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![diegoholiveira](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/diegoholiveira/32/13475_2.png) [@diegoholiveira](https://discuss.elastic.co/u/diegoholiveira)\
**Post date:** [November 29, 2016, 1:41pm UTC](https://discuss.elastic.co/t/elasticsearch-and-geo-point-not-working-as-i-expect-what-im-doing-wrong/67487/1 "2016-11-29T13:41:26Z")

</div>

Hey guys. I have an elastic search instance and I indexing events with location. My mapping is:

```
{
  "mappings": {
    "event": {
      "properties": {
        "id": { "type": "long", "index": "not_analyzed" },
        "name": {"type": "string"},
        "description": {"type": "string",},
        "start_date": { "type": "date" },
        "end_date": { "type": "date" },
        "coordinates": { "type": "geo_point" }
      }
    }
  }
}

```

Then I search for event close to me using this query:

```
{
	"sort": [
		{
			"_geo_distance": {
				"distance_type": "plane",
				"unit": "km",
				"coordinates": {"lat": -21.1726736, "lon": -47.8594995},
				"order": "asc"
			}
		}
	],
	"query": {
		"filtered": {
			"filter": {
				"bool": {
					"must": [
						{"range": {"end_date": {"gt": "2016-11-29T11:36:27-02:00"}}},
						{"term": {"is_published": true}},
						{"term": {"is_private": false}},
						{"term": {"is_cancelled": false}},
						{"term": {"is_closed": false}}
					]
				}
			}
		}
	},
	"size": 15,
	"from": 0
}

```

Then, when I inspect the result to see the distance of the event from the coordinates that I send, I got this:

```
[1.7976931348623157e+308]
[1.7976931348623157e+308]
[1.7976931348623157e+308]
[1.7976931348623157e+308]
[1.7976931348623157e+308]
[1.7976931348623157e+308]
[1.7976931348623157e+308]
[1.7976931348623157e+308]
[1.7976931348623157e+308]
[1.7976931348623157e+308]
[1.7976931348623157e+308]
[1.7976931348623157e+308]
[1.7976931348623157e+308]
[1.7976931348623157e+308]
[1.7976931348623157e+308]

```

All distances are TOO BIG, even when the event is kind of close of the point that I send.

What I'm doing wrong here?

Thanks in advance.

---

<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:** [December 27, 2016, 1:41pm UTC](https://discuss.elastic.co/t/elasticsearch-and-geo-point-not-working-as-i-expect-what-im-doing-wrong/67487/2 "2016-12-27T13:41:40Z")

</div>

Closed on December 27, 2016, 1:41pm UTC

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