# Convert the “facet\_filter” query into pyes format

**URL:** <https://discuss.elastic.co/t/convert-the-facet-filter-query-into-pyes-format/9011>\
**Category:** Elasticsearch\
**Created:** [September 13, 2012, 11:35am UTC](https://discuss.elastic.co/t/convert-the-facet-filter-query-into-pyes-format/9011 "2012-09-13T11:35:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suraj](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@Suraj](https://discuss.elastic.co/u/Suraj)\
**Post date:** [September 13, 2012, 11:35am UTC](https://discuss.elastic.co/t/convert-the-facet-filter-query-into-pyes-format/9011/1 "2012-09-13T11:35:14Z")

</div>

I have a following query and I want to change that query into PyES:

{  
"facets": {  
"participating-org.name": {  
"terms": {  
"field": "participating-org.name"  
},  
"facet\_filter": {  
"term": {  
"participating-org.role": "funding"  
}  
},  
"nested": "participating-org"  
}  
}  
}

I have searched in PyES documentation about this "facet\_filter" but  
couldn't come up with good query in PyES.  
_So need some HELP for converting this JSON query into PyES format._

--

---

<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, 3:12am UTC](https://discuss.elastic.co/t/convert-the-facet-filter-query-into-pyes-format/9011/2 "2017-07-06T03:12:55Z")

</div>


