# Elasticsearch: “reason”: “failed to find geo\_point field”

**URL:** <https://discuss.elastic.co/t/elasticsearch-reason-failed-to-find-geo-point-field/51883>\
**Category:** Elasticsearch\
**Created:** [June 5, 2016, 7:14pm UTC](https://discuss.elastic.co/t/elasticsearch-reason-failed-to-find-geo-point-field/51883 "2016-06-05T19:14:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![quadrim](https://avatars.discourse-cdn.com/v4/letter/q/a4c791/32.png) [@quadrim](https://discuss.elastic.co/u/quadrim)\
**Post date:** [June 5, 2016, 7:14pm UTC](https://discuss.elastic.co/t/elasticsearch-reason-failed-to-find-geo-point-field/51883/1 "2016-06-05T19:14:54Z")

</div>

I am trying to sync mysql data (which changes dynamically) with `elasticsearch`. I am using `logstash` for the syncing purpose. I need to filter the list of vehicles in the radius of 1KM for the passed `geo_points`. While making a geo\_point query on elasticsearch, I am getting error as:

> ```
> {"error":
> {"root_cause": [
> {"type": "query_parsing_exception",
> "reason": "failed to find geo_point field [location]",
> "index":"current_location",
> "line":13,
> "col":9}
> ],
> "type": "search_phase_execution_exception",
> "reason": "all shards failed",
> "phase":"query",
> "grouped": true,
> "failed_shards":[
> {"shard":0,
> "index": "current_location",
> "node":"Pf8eXXX2QMuaskBuLSdcXw",
> "reason": {
> "type":"query_parsing_exception",
> "reason":"failed to find geo_point field [location]",
> "index":"current_location",
> "line":13,
> "col":9}}
> ]},
> "status":400}
> 
> ```

`Curl` call that I am making is:

> ```
> curl -XGET http://MY.ELASTIC.SEARCH.IP:9200/current_location/vehicle/_search -d '
> {
> "query": {
> "filtered": {
> "filter": {
> "geo_distance": {
> "distance": "1km",
> "distance_type": "plane", 
> "location": {
> "lat": 40.715,
> "lon": -73.988
> }
> }
> }
> }
> }
> 
> ```
> 
> }'

Result of curl call on any of the index is as:

> ```
> curl -XGET http://MY.ELASTIC.SEARCH.IP:9200/current_location/vehicle/XX12XX34XX56
> {
> "_index": "current_location",
> "_type": "vehicle",
> "_id": "XX12XX34XX56",
> "_version": 1,
> "found": true,
> "_source": {
> "obd_id": "XX12XX34XX56",
> "system_timestamp": 1464855810,
> "gps_timestamp": 1464855807,
> "speed": 1.476,
> "direction": 0,
> "latitude": 12.9699,
> "longitude": 77.7004,
> "@version": "1",
> "@timestamp": "2016-06-05T16:09:46.712Z",
> "type": "vehicle",
> "location": {
> "lat": 12.9699,
> "lon": 77.7004
> }
> }
> }
> 
> ```

Content of my `logstash.conf` file is:

> ```
> input {
> jdbc {
> jdbc_connection_string => "jdbc:mysql://MY.MYSQL.DB.IP:3306/my_db"
> jdbc_user => "MY_USER"
> jdbc_password => "MY_PASSWORD"
> jdbc_validate_connection => true
> jdbc_driver_library => "/home/moin/moin/mysql-connector-java-5.1.39-bin.jar"
> jdbc_driver_class => "com.mysql.jdbc.Driver"
> statement => "SELECT obd_id, system_timestamp, gps_timestamp, speed*0.036 as speed, direction, latitude/3600000.00 as latitude, longitude/3600000.00 as longitude from current_location"
> use_column_value => true
> tracking_column => system_timestamp
> add_field => {"type" => "vehicle"}
> }
> }
> filter {
> if [latitude] and [longitude] {
> mutate {
> add_field => {
> "[location][lat]" => "%{latitude}"
> "[location][lon]" => "%{longitude}"
> }
> }
> mutate {
> convert => {
> "[location][lat]" => "float"
> "[location][lon]" => "float"
> }
> }
> }
> } 
> output {
> elasticsearch {
> index => "current_location"
> template_overwrite => true
> template => "/tmp/current-loc.json"
> document_type => "%{type}"
> document_id => "%{obd_id}"
> hosts => "MY.ELASTIC.SEARCH.IP"
> }
> }
> 
> ```

My template file can be found at: [current-loc.json](https://gist.github.com/anonymous/4b327a53fafcee8a511fadb64245097e)

I tried almost everything available on internet. Any idea on how achieve it will be helpful. Thanks in advance. 🙂

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 11, 2016, 5:00pm UTC](https://discuss.elastic.co/t/elasticsearch-reason-failed-to-find-geo-point-field/51883/2 "2016-06-11T17:00:10Z")

</div>

What do the actual mappings of the index look like?

---

<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, 10:44pm UTC](https://discuss.elastic.co/t/elasticsearch-reason-failed-to-find-geo-point-field/51883/3 "2017-07-05T22:44:35Z")

</div>


