# Has\_parent does not support filter

**URL:** https://discuss.elastic.co/t/has-parent-does-not-support-filter/23312
**Category:** Elasticsearch
**Created:** [April 19, 2015, 5:33pm UTC](https://discuss.elastic.co/t/has-parent-does-not-support-filter/23312 "2015-04-19T17:33:09Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jim\_ross](https://avatars.discourse-cdn.com/v4/letter/j/2bfe46/32.png) [@jim\_ross](https://discuss.elastic.co/u/jim_ross)
#### Post date: [April 19, 2015, 5:33pm UTC](https://discuss.elastic.co/t/has-parent-does-not-support-filter/23312/1 "2015-04-19T17:33:09Z")

</div>

Hello, I'm new to ElasitcSearch and struggling a bit trying to learn the  
query syntax. Spent ages trying to get a query working that searches  
children and uses a filter on parent, specifically find all persons named  
Jim within a given geo distance of a branch location, like this:

/\_search  
{  
"query" : {  
"filtered": {  
"query": {  
"match" : {  
"person\_name": "jim"  
},  
"filter" : {  
"has\_parent" : {  
"type" : "branch",

"filter" : {  
"geo\_distance" : {  
"distance" : "5mi",  
"location" : {  
"lat" : 40.00,  
"lon" : -74.00  
}  
}  
}  
}  
}  
}  
}  
}  
}

This gives an error that has this in it: _nested:  
QueryParsingException[[places] [has\_parent] query does not support  
[filter]]_.  
But this page:  
[http://www.elastic.co/guide/en/elasticsearch/reference/1.3/query-dsl-has-parent-filter.html](http://www.elastic.co/guide/en/elasticsearch/reference/1.3/query-dsl-has-parent-filter.html)  
seems to say that this is valid syntax. Confused over what syntax is  
allowed where. How would I do a query like this? Is it even possible? I  
don't really want to try de-normalizing all my data, just too much of it.

The geo location part by itself as a query works fine, it seems any kind of  
filter inside has\_parent gives the same error.

Also, pretty minor, but is there any way to strip off all those literal  
'\n' and '\t' characters that are in my nicely formatted request but are  
then returned in the 400 error response? 90% of my responses right now are  
errors while I learn this stuff and they make it hard to read! Without them  
the response would be much easier to read in a json formatter such as one  
of the chrome plugins.

--  
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/2301a7e5-e718-4965-8527-1a200be55efe%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2301a7e5-e718-4965-8527-1a200be55efe%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:18am UTC](https://discuss.elastic.co/t/has-parent-does-not-support-filter/23312/2 "2017-07-06T00:18:50Z")

</div>


