# Filter geo\_distance - Failed to parse source

**URL:** <https://discuss.elastic.co/t/filter-geo-distance-failed-to-parse-source/4265>\
**Category:** Elasticsearch\
**Created:** [April 20, 2011, 10:56am UTC](https://discuss.elastic.co/t/filter-geo-distance-failed-to-parse-source/4265 "2011-04-20T10:56:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xrado](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xrado/32/3208_2.png) [@xrado](https://discuss.elastic.co/u/xrado)\
**Post date:** [April 20, 2011, 10:56am UTC](https://discuss.elastic.co/t/filter-geo-distance-failed-to-parse-source/4265/1 "2011-04-20T10:56:19Z")

</div>

Hi,

i'm trying to filter by geo\_distance, but always geting error (logs) "Failed  
to parse source"

i have query:

{  
"query": {  
"filtered" : {  
"query" : {  
"field" : {  
"\_all" : "test~0.3"  
}  
},  
"filter" : {  
"term" : { "model" : "company" }  
}  
}  
}  
}

..which work fine, then i add geo\_distance

{  
"query": {  
"filtered" : {  
"query" : {  
"field" : {  
"\_all" : "test~0.3"  
}  
},  
"filter" : {  
"geo\_distance" : {  
"distance" : "200km",  
"location" : {  
"lat" : 40,  
"lon" : -70  
}  
}  
}  
}  
}  
}

i get Failed to parse source

i mapped location as geo\_point type

what am i doing wrong?

--  
View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/filter-geo-distance-Failed-to-parse-source-tp2842327p2842327.html](http://elasticsearch-users.115913.n3.nabble.com/filter-geo-distance-Failed-to-parse-source-tp2842327p2842327.html)  
Sent from the ElasticSearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [April 23, 2011, 8:34pm UTC](https://discuss.elastic.co/t/filter-geo-distance-failed-to-parse-source/4265/2 "2011-04-23T20:34:25Z")

</div>

Please _gist_ your samples, and the failure that you are getting.  
On Wednesday, April 20, 2011 at 1:56 PM, xrado wrote:

> Hi,
> 
> i'm trying to filter by geo\_distance, but always geting error (logs) "Failed  
> to parse source"
> 
> i have query:
> 
> {  
> "query": {  
> "filtered" : {  
> "query" : {  
> "field" : {  
> "\_all" : "test~0.3"  
> }  
> },  
> "filter" : {  
> "term" : { "model" : "company" }  
> }  
> }  
> }  
> }
> 
> ..which work fine, then i add geo\_distance
> 
> {  
> "query": {  
> "filtered" : {  
> "query" : {  
> "field" : {  
> "\_all" : "test~0.3"  
> }  
> },  
> "filter" : {  
> "geo\_distance" : {  
> "distance" : "200km",  
> "location" : {  
> "lat" : 40,  
> "lon" : -70  
> }  
> }  
> }  
> }  
> }  
> }
> 
> i get Failed to parse source
> 
> i mapped location as geo\_point type
> 
> what am i doing wrong?
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/filter-geo-distance-Failed-to-parse-source-tp2842327p2842327.html](http://elasticsearch-users.115913.n3.nabble.com/filter-geo-distance-Failed-to-parse-source-tp2842327p2842327.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<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, 4:07am UTC](https://discuss.elastic.co/t/filter-geo-distance-failed-to-parse-source/4265/3 "2017-07-06T04:07:47Z")

</div>


