# Possible to create a facet covering multiple array fields

**URL:** <https://discuss.elastic.co/t/possible-to-create-a-facet-covering-multiple-array-fields/12950>\
**Category:** Elasticsearch\
**Created:** [July 26, 2013, 6:47am UTC](https://discuss.elastic.co/t/possible-to-create-a-facet-covering-multiple-array-fields/12950 "2013-07-26T06:47:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lukasz\_Goral](https://avatars.discourse-cdn.com/v4/letter/l/779978/32.png) [@Lukasz\_Goral](https://discuss.elastic.co/u/Lukasz_Goral)\
**Post date:** [July 26, 2013, 6:47am UTC](https://discuss.elastic.co/t/possible-to-create-a-facet-covering-multiple-array-fields/12950/1 "2013-07-26T06:47:55Z")

</div>

Hi.

Suppose I have the following index comprised of 3 documents:  
Field subject and level are "type": "string".

subject:["math", "geo"], level:["first"]  
subject:["ang", "geo"], level:["first", "second"]  
subject:["geo"], level:["second", "fourth"]

The use case requires that I retrieve a facet on subject with the  
following counts:  
math-first: 1  
geo-first: 2  
ang-first:1  
ang-second:1  
geo-second:2  
geo-fourth:1

Is this possible in elasticsearch with one search?  
How to do this?  
Thanks for help

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:24am UTC](https://discuss.elastic.co/t/possible-to-create-a-facet-covering-multiple-array-fields/12950/2 "2017-07-06T02:24:25Z")

</div>

Closed on July 6, 2017, 2:24am UTC


