# No mapping found error for geo\_distance sorting

**URL:** <https://discuss.elastic.co/t/no-mapping-found-error-for-geo-distance-sorting/15276>\
**Category:** Elasticsearch\
**Created:** [January 16, 2014, 5:21pm UTC](https://discuss.elastic.co/t/no-mapping-found-error-for-geo-distance-sorting/15276 "2014-01-16T17:21:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Travis\_Bullock](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@Travis\_Bullock](https://discuss.elastic.co/u/Travis_Bullock)\
**Post date:** [January 16, 2014, 5:21pm UTC](https://discuss.elastic.co/t/no-mapping-found-error-for-geo-distance-sorting/15276/1 "2014-01-16T17:21:20Z")

</div>

Hello,

I've set up a mapping on myIndex as follows:

"mappings" : {  
"place" : {  
"properties" : {  
"location" : {  
"type" : "geo\_point",  
"fielddata" : {  
"format" : "compressed",  
"precision" : "3m"  
}  
}  
}  
}  
}

And indexed data like so:

{"\_index":"myIndex","\_type":"place","\_id":"328","\_version":2,"exists":true, "\_source" : {"location":{"lat":42.02397,"lon":-87.684965}}

When querying I get an error:

{  
"index": "myIndex",  
"size": 10,  
"from": 1,  
"type": "place",  
"filtered": {  
"query": {  
"query\_string": "test"  
},  
"bool": {  
"must": [  
{  
"geo\_distance": {  
"distance": "150mi",  
"place.location": {  
"lat": "41.8781136",  
"lon": "-87.6297982"  
}  
}  
}  
]  
}  
},  
"sort": [  
{  
"geo\_distance": {  
"location": {  
"lat": "41.8781136",  
"lon": "-87.6297982"  
},  
"unit": "mi",  
"order": "ASC"  
}  
}  
]  
}

The error is "Parse Failure [No mapping found for [[object Object]] in order to sort on"

I've tried changing location to place.location in the sort.

Also, should I use "\_geo\_distance" or "geo\_distance"? Why are they both used in different documentation?

Thanks!

Travis

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/452ec200-001d-4347-b756-6350b281d59c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/452ec200-001d-4347-b756-6350b281d59c%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 16, 2014, 5:31pm UTC](https://discuss.elastic.co/t/no-mapping-found-error-for-geo-distance-sorting/15276/2 "2014-01-16T17:31:32Z")

</div>

See doc: [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#\_geo\_distance\_sorting](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#_geo_distance_sorting)

Missing \_ I guess

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 16 janvier 2014 at 18:21:24, Travis Bullock ([travisrbullock@gmail.com](mailto:travisrbullock@gmail.com)) a écrit:

Hello,

I've set up a mapping on myIndex as follows:

"mappings" : {  
"place" : {  
"properties" : {  
"location" : {  
"type" : "geo\_point",  
"fielddata" : {  
"format" : "compressed",  
"precision" : "3m"  
}  
}  
}  
}  
}

And indexed data like so:

{"\_index":"myIndex","\_type":"place","\_id":"328","\_version":2,"exists":true, "\_source" : {"location":{"lat":42.02397,"lon":-87.684965}}

When querying I get an error:

{  
"index": "myIndex",  
"size": 10,  
"from": 1,  
"type": "place",  
"filtered": {  
"query": {  
"query\_string": "test"  
},  
"bool": {  
"must": [  
{  
"geo\_distance": {  
"distance": "150mi",  
"place.location": {  
"lat": "41.8781136",  
"lon": "-87.6297982"  
}  
}  
}  
]  
}  
},  
"sort": [  
{  
"geo\_distance": {  
"location": {  
"lat": "41.8781136",  
"lon": "-87.6297982"  
},  
"unit": "mi",  
"order": "ASC"  
}  
}  
]  
}

The error is "Parse Failure [No mapping found for [[object Object]] in order to sort on"

I've tried changing location to place.location in the sort.  
Also, should I use "\_geo\_distance" or "geo\_distance"? Why are they both used in different documentation?

## Thanks! Travis

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/452ec200-001d-4347-b756-6350b281d59c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/452ec200-001d-4347-b756-6350b281d59c%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/etPan.52d81774.4e6afb66.dc5%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.52d81774.4e6afb66.dc5%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Travis\_Bullock](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@Travis\_Bullock](https://discuss.elastic.co/u/Travis_Bullock)\
**Post date:** [January 16, 2014, 5:40pm UTC](https://discuss.elastic.co/t/no-mapping-found-error-for-geo-distance-sorting/15276/3 "2014-01-16T17:40:08Z")

</div>

Thanks, I already tried that with no luck.

On Thursday, January 16, 2014 11:31:32 AM UTC-6, David Pilato wrote:

> See doc:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#_geo_distance_sorting)
> 
> Missing \_ I guess
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 16 janvier 2014 at 18:21:24, Travis Bullock ([travisr...@gmail.com](mailto:travisr...@gmail.com)\<javascript:\>)  
> a écrit:
> 
> Hello,
> 
> I've set up a mapping on myIndex as follows:
> 
> "mappings" : {  
> "place" : {  
> "properties" : {  
> "location" : {  
> "type" : "geo\_point",  
> "fielddata" : {  
> "format" : "compressed",  
> "precision" : "3m"  
> }  
> }  
> }  
> }  
> }
> 
> And indexed data like so:
> 
> {"\_index":"myIndex","\_type":"place","\_id":"328","\_version":2,"exists":true, "\_source" : {"location":{"lat":42.02397,"lon":-87.684965}}
> 
> When querying I get an error:
> 
> {  
> "index": "myIndex",  
> "size": 10,  
> "from": 1,  
> "type": "place",  
> "filtered": {  
> "query": {  
> "query\_string": "test"  
> },  
> "bool": {  
> "must": [  
> {  
> "geo\_distance": {  
> "distance": "150mi",  
> "place.location": {  
> "lat": "41.8781136",  
> "lon": "-87.6297982"  
> }  
> }  
> }  
> ]  
> }  
> },  
> "sort": [  
> {  
> "geo\_distance": {  
> "location": {  
> "lat": "41.8781136",  
> "lon": "-87.6297982"  
> },  
> "unit": "mi",  
> "order": "ASC"  
> }  
> }  
> ]  
> }
> 
> The error is "Parse Failure [No mapping found for [[object Object]] in order to sort on"
> 
> I've tried changing location to place.location in the sort.
> 
> Also, should I use "\_geo\_distance" or "geo\_distance"? Why are they both used in different documentation?
> 
> Thanks!
> 
> Travis
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/452ec200-001d-4347-b756-6350b281d59c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/452ec200-001d-4347-b756-6350b281d59c%40googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/31154fe7-e730-4147-946a-e8f8c2912949%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/31154fe7-e730-4147-946a-e8f8c2912949%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 16, 2014, 5:52pm UTC](https://discuss.elastic.co/t/no-mapping-found-error-for-geo-distance-sorting/15276/4 "2014-01-16T17:52:05Z")

</div>

Could you reproduce it with a curl recreation as explained here? [http://www.elasticsearch.org/help/](http://www.elasticsearch.org/help/)

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 16 janvier 2014 at 18:40:12, Travis Bullock ([travisrbullock@gmail.com](mailto:travisrbullock@gmail.com)) a écrit:

Thanks, I already tried that with no luck.

On Thursday, January 16, 2014 11:31:32 AM UTC-6, David Pilato wrote:  
See doc: [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#\_geo\_distance\_sorting](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#_geo_distance_sorting)

Missing \_ I guess

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 16 janvier 2014 at 18:21:24, Travis Bullock ([travisr...@gmail.com](mailto:travisr...@gmail.com)) a écrit:

Hello,

I've set up a mapping on myIndex as follows:

"mappings" : {  
"place" : {  
"properties" : {  
"location" : {  
"type" : "geo\_point",  
"fielddata" : {  
"format" : "compressed",  
"precision" : "3m"  
}  
}  
}  
}  
}

And indexed data like so:

{"\_index":"myIndex","\_type":"place","\_id":"328","\_version":2,"exists":true, "\_source" : {"location":{"lat":42.02397,"lon":-87.684965}}

When querying I get an error:

{  
"index": "myIndex",  
"size": 10,  
"from": 1,  
"type": "place",  
"filtered": {  
"query": {  
"query\_string": "test"  
},  
"bool": {  
"must": [  
{  
"geo\_distance": {  
"distance": "150mi",  
"place.location": {  
"lat": "41.8781136",  
"lon": "-87.6297982"  
}  
}  
}  
]  
}  
},  
"sort": [  
{  
"geo\_distance": {  
"location": {  
"lat": "41.8781136",  
"lon": "-87.6297982"  
},  
"unit": "mi",  
"order": "ASC"  
}  
}  
]  
}

The error is "Parse Failure [No mapping found for [[object Object]] in order to sort on"

I've tried changing location to place.location in the sort.  
Also, should I use "\_geo\_distance" or "geo\_distance"? Why are they both used in different documentation?

## Thanks! Travis

## You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com). To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/452ec200-001d-4347-b756-6350b281d59c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/452ec200-001d-4347-b756-6350b281d59c%40googlegroups.com). For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/31154fe7-e730-4147-946a-e8f8c2912949%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/31154fe7-e730-4147-946a-e8f8c2912949%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/etPan.52d81c45.3f2dba31.dc5%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.52d81c45.3f2dba31.dc5%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Travis\_Bullock](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@Travis\_Bullock](https://discuss.elastic.co/u/Travis_Bullock)\
**Post date:** [January 16, 2014, 7:02pm UTC](https://discuss.elastic.co/t/no-mapping-found-error-for-geo-distance-sorting/15276/5 "2014-01-16T19:02:37Z")

</div>

Thanks again. By working with a gist I figured out the problem was with how  
I'm using the javascript client. The sort wasn't in the "body" of my json  
request.

On Thursday, January 16, 2014 11:52:05 AM UTC-6, David Pilato wrote:

> Could you reproduce it with a curl recreation as explained here?  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help/)
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 16 janvier 2014 at 18:40:12, Travis Bullock ([travisr...@gmail.com](mailto:travisr...@gmail.com)\<javascript:\>)  
> a écrit:
> 
> Thanks, I already tried that with no luck.
> 
> On Thursday, January 16, 2014 11:31:32 AM UTC-6, David Pilato wrote:
> 
> > See doc:  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#_geo_distance_sorting)
> > 
> > Missing \_ I guess
> > 
> > ```
> > -- 
> > 
> > ```
> > 
> > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> > 
> > Le 16 janvier 2014 at 18:21:24, Travis Bullock ([travisr...@gmail.com](mailto:travisr...@gmail.com)) a  
> > écrit:
> > 
> > Hello,
> > 
> > I've set up a mapping on myIndex as follows:
> > 
> > "mappings" : {  
> > "place" : {  
> > "properties" : {  
> > "location" : {  
> > "type" : "geo\_point",  
> > "fielddata" : {  
> > "format" : "compressed",  
> > "precision" : "3m"  
> > }  
> > }  
> > }  
> > }  
> > }
> > 
> > And indexed data like so:
> > 
> > {"\_index":"myIndex","\_type":"place","\_id":"328","\_version":2,"exists":true, "\_source" : {"location":{"lat":42.02397,"lon":-87.684965}}
> > 
> > When querying I get an error:
> > 
> > {  
> > "index": "myIndex",  
> > "size": 10,  
> > "from": 1,  
> > "type": "place",  
> > "filtered": {  
> > "query": {  
> > "query\_string": "test"  
> > },  
> > "bool": {  
> > "must": [  
> > {  
> > "geo\_distance": {  
> > "distance": "150mi",  
> > "place.location": {  
> > "lat": "41.8781136",  
> > "lon": "-87.6297982"  
> > }  
> > }  
> > }  
> > ]  
> > }  
> > },  
> > "sort": [  
> > {  
> > "geo\_distance": {  
> > "location": {  
> > "lat": "41.8781136",  
> > "lon": "-87.6297982"  
> > },  
> > "unit": "mi",  
> > "order": "ASC"  
> > }  
> > }  
> > ]  
> > }
> > 
> > The error is "Parse Failure [No mapping found for [[object Object]] in order to sort on"
> > 
> > I've tried changing location to place.location in the sort.
> > 
> > Also, should I use "\_geo\_distance" or "geo\_distance"? Why are they both used in different documentation?
> > 
> > Thanks!
> > 
> > Travis
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/452ec200-001d-4347-b756-6350b281d59c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/452ec200-001d-4347-b756-6350b281d59c%40googlegroups.com)  
> > .  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/31154fe7-e730-4147-946a-e8f8c2912949%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/31154fe7-e730-4147-946a-e8f8c2912949%40googlegroups.com)  
> > .  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/05a4cff7-596e-4a64-9e40-acd1163df983%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/05a4cff7-596e-4a64-9e40-acd1163df983%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 1:56am UTC](https://discuss.elastic.co/t/no-mapping-found-error-for-geo-distance-sorting/15276/6 "2017-07-06T01:56:20Z")

</div>


