# Can I accomplish this facet with my data structure?

**URL:** <https://discuss.elastic.co/t/can-i-accomplish-this-facet-with-my-data-structure/15303>\
**Category:** Elasticsearch\
**Created:** [January 17, 2014, 10:16pm UTC](https://discuss.elastic.co/t/can-i-accomplish-this-facet-with-my-data-structure/15303 "2014-01-17T22:16:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Fill](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jason_fill/32/1861_2.png) [@Jason\_Fill](https://discuss.elastic.co/u/Jason_Fill)\
**Post date:** [January 17, 2014, 10:16pm UTC](https://discuss.elastic.co/t/can-i-accomplish-this-facet-with-my-data-structure/15303/1 "2014-01-17T22:16:18Z")

</div>

I have provided a sample record below and I want to see if based on this  
data, I can output the facet I am looking for.

{  
user: {  
name: "bob",  
metadata: [  
{  
questionid: 448  
parameterid: cid  
response: 71668  
},  
{  
questionid: 449  
parameterid: dc  
response: AP100  
},  
{  
questionid: 450  
parameterid: cc  
response: GHUE  
}  
]  
}  
}

I am looking to create a facet that will tell me the number of occurrences  
for the responses based on the paramterid groups. So for example:

_CID_  
71668 (3)

_DC_  
AP100 (2)

_CC_  
DHUE (3)

The numbers in the parenthesis indicate a sample of how many of each were  
found - these of course are made up numbers.

So basically, I want to ensure I group each of the responses by the  
parameterid. So for example if GHUE actually appeared under the "dc"  
parameterid, it would be counted under that group and we would see a DHUE  
under each cc and dc.

I hope that makes sense.

Thanks in advance.

Jason

--  
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/3dcd0777-e309-4e23-95b1-04a29c77fe7d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3dcd0777-e309-4e23-95b1-04a29c77fe7d%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![brian\_yoder](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@brian\_yoder](https://discuss.elastic.co/u/brian_yoder)\
**Post date:** [January 21, 2014, 4:49pm UTC](https://discuss.elastic.co/t/can-i-accomplish-this-facet-with-my-data-structure/15303/2 "2014-01-21T16:49:42Z")

</div>

Jason,

Perhaps this might describe what you're looking for. It's based on ES  
version 0.90.X:

[https://groups.google.com/d/msg/elasticsearch/p4i3GvGDoUs/NFZat2BNj-wJ](https://groups.google.com/d/msg/elasticsearch/p4i3GvGDoUs/NFZat2BNj-wJ)

I don't know what's in store for ES 1.X that might implement this.

I hope this helps you!

Brian

--  
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/a6880cd4-e3b4-4a0a-87e1-fea8f305b10a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a6880cd4-e3b4-4a0a-87e1-fea8f305b10a%40googlegroups.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, 1:55am UTC](https://discuss.elastic.co/t/can-i-accomplish-this-facet-with-my-data-structure/15303/3 "2017-07-06T01:55:33Z")

</div>

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


