# Having issues in elasticsearch geo\_point search query in node js application

**URL:** <https://discuss.elastic.co/t/having-issues-in-elasticsearch-geo-point-search-query-in-node-js-application/114064>\
**Category:** Elasticsearch\
**Created:** [January 4, 2018, 10:50am UTC](https://discuss.elastic.co/t/having-issues-in-elasticsearch-geo-point-search-query-in-node-js-application/114064 "2018-01-04T10:50:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thealitahir](https://avatars.discourse-cdn.com/v4/letter/t/c57346/32.png) [@thealitahir](https://discuss.elastic.co/u/thealitahir)\
**Post date:** [January 4, 2018, 10:50am UTC](https://discuss.elastic.co/t/having-issues-in-elasticsearch-geo-point-search-query-in-node-js-application/114064/1 "2018-01-04T10:50:10Z")

</div>

Hey there! Hope you doing fine. I'm working on node js (version 6.1.0 ) application and using elasticsearch (version 5.0.1) in it. But I'm having issues in geo\_point query.  
I'm doing mapping like this

```
client.indices.putMapping({
    index: 'newtesting',
    type: 'newtesting',
    body: {
        properties: {
            vendor_id: {type: "string", store: true},
            address: {type: "string", store: true},
            geoABC: {
                "store": true,
                "type": "geo_point",
                "lat_lon": true
            }
        }
    }
});

```

and inserting data like this

```
client.index({
                index: 'newtesting',
                type: 'newtesting',
                body: {
                    vendor_id: req.params.id,
                    address: req.params.address,
                    geoABC: {
                        "type": "Point",
                        "coordinates": [
                            req.params.lat,
                            req.params.lng
                        ]
                    }
                }
            },
            function (err, result, ElasticStatus) {
                if(err)
                    res.send("Unable to add Vendor Location" + err );
                else{
                    console.log("Location Stored "+result);
                    res.send(result);
                }

            });

```

and doing searching like this

```
 client.search({
                index: 'newtesting',
                type: 'newtesting',
                body: {
                    "query": {
                        "bool" : {
                            "must" : {
                                "match_all" : { }
                            },
                            "filter" : {
                                "geo_distance" : {
                                    "distance" : "150km",
                                    "geoABC" : {
                                        "lat" : "31.479386",
                                        "lon" : "74.341769"
                                    }
                                }
                            }
                        }
                    }
                }
            }).then(function (resp) {
                var hits = resp.hits.hits;
                console.log(hits.length, "items around");
            }).catch(function (error) {
                console.log("Error on geo_distance (coordiates) " + error);
            });

```

I've tried many different formats, but I always get this same error, tried different versions as well, but same error  
"[query\_shard\_exception] failed to find geo\_point field [geoABC]"  
Please help me if you have any idea about this

---

<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:** [February 1, 2018, 10:51am UTC](https://discuss.elastic.co/t/having-issues-in-elasticsearch-geo-point-search-query-in-node-js-application/114064/2 "2018-02-01T10:51:34Z")

</div>

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