# Facet on multiple properties

**URL:** <https://discuss.elastic.co/t/facet-on-multiple-properties/17717>\
**Category:** Elasticsearch\
**Created:** [May 25, 2014, 6:08pm UTC](https://discuss.elastic.co/t/facet-on-multiple-properties/17717 "2014-05-25T18:08:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eunever32](https://avatars.discourse-cdn.com/v4/letter/e/e68b1a/32.png) [@eunever32](https://discuss.elastic.co/u/eunever32)\
**Post date:** [May 25, 2014, 6:08pm UTC](https://discuss.elastic.co/t/facet-on-multiple-properties/17717/1 "2014-05-25T18:08:28Z")

</div>

Hey,.

Say I have a list of properties below,  
what is the facet query that will give me the totals of where each field  
occurs.  
In the example below, I want to see f1: 4 etc

index/type/1  
{  
"my\_doc": {  
"list": [  
{  
"f1": "aaa",  
"f2": "bbb",  
"f3": "ccc",  
"f5": "ddd",  
"f4": "eee",  
"f6": " "  
},  
{  
"f1": "aaa",  
"f3": "bbb",  
"f4": "ccc",  
"f2": "ddd",  
"f5": "eee",  
"f6": " "  
}]

}  
index/type/2  
{  
"my\_doc": {  
"list": [  
{  
"f1": "aaa",  
"f3": "bbb",  
"f4": "ccc",  
"f2": "ddd",  
"f5": "eee",  
"f6": " "  
},  
{  
"f1": "aaa",  
"f3": "bbb",  
"f4": "ccc",  
"f2": "ddd",  
"f5": "eee",  
"f6": " "  
}  
}

I want to get counts of each field f1, f2, f3, f4, f5, f6  
Totals:  
f1: 4  
f2: 4  
f3: 4  
f4: 4  
f5: 4  
f6: 4

--  
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/cbc9a88e-c61b-46e1-93d1-5bcd1acdd423%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cbc9a88e-c61b-46e1-93d1-5bcd1acdd423%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, 1:27am UTC](https://discuss.elastic.co/t/facet-on-multiple-properties/17717/2 "2017-07-06T01:27:05Z")

</div>

Closed on July 6, 2017, 1:27am UTC


