# Multi field terms facet

**URL:** <https://discuss.elastic.co/t/multi-field-terms-facet/3797>\
**Category:** Elasticsearch\
**Created:** [January 17, 2011, 10:22pm UTC](https://discuss.elastic.co/t/multi-field-terms-facet/3797 "2011-01-17T22:22:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nmosafi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nmosafi/32/3280_2.png) [@nmosafi](https://discuss.elastic.co/u/nmosafi)\
**Post date:** [January 17, 2011, 10:22pm UTC](https://discuss.elastic.co/t/multi-field-terms-facet/3797/1 "2011-01-17T22:22:03Z")

</div>

Hi there

I am trying to use the multi field terms facet. Say I have documents which look like this:

{  
"fruit": "apple",  
"colour": "green",  
"size": "large"  
},  
{  
"fruit": "banana",  
"colour": "yellow",  
"size": "large"  
},  
{  
"fruit": "grape",  
"colour": "green",  
"size": "small"  
}

and I run a multi terms facet:

{  
"query": { "match\_all": {} },  
"size": 0,  
"facets": { "myFacet": { "terms": { "fields" : ["colour", "size"] } } }  
}

Here I am trying to get three facets to be returned

{"terms": ["green", "large"], "count": 1 }  
{"terms": ["yellow", "large"], "count": 1 }  
{"terms": ["green", "small"], "count": 1 }

However I get back this

{"term": "green", "count": 2 }  
{"term": "yellow", "count": 1 }  
{"term": "large", "count": 2 }  
{"term": "small", "count": 1 }

Is there a way to achieve what I am trying?

---

<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:13am UTC](https://discuss.elastic.co/t/multi-field-terms-facet/3797/2 "2017-07-06T04:13:39Z")

</div>


