# Facets and facet value pair

**URL:** <https://discuss.elastic.co/t/facets-and-facet-value-pair/5711>\
**Category:** Elasticsearch\
**Created:** [October 27, 2011, 8:05pm UTC](https://discuss.elastic.co/t/facets-and-facet-value-pair/5711 "2011-10-27T20:05:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vineeth\_mohan](https://avatars.discourse-cdn.com/v4/letter/v/bc79bd/32.png) [@vineeth\_mohan](https://discuss.elastic.co/u/vineeth_mohan)\
**Post date:** [October 27, 2011, 8:05pm UTC](https://discuss.elastic.co/t/facets-and-facet-value-pair/5711/1 "2011-10-27T20:05:53Z")

</div>

Hi ,

I have a datastructure like ,

{  
Content: "this is from company XYZ doing something towards end",  
tags:[{"company":xyz}, {"source":"homeo"},{"place":"america"}]  
}

Now i want to search based on Content field and provide me with facet list.  
The facet list should be like ["company":2 , "place" : 3] (Value pair  
should not be searched , instead only key should be considered as facets.

Is this possible directly

i know if i spilt the datastructure to  
{  
Content: "this is from company XYZ doing something towards end",  
tags:[{"company","source","place"],  
"company":xyz,  
"source":"homeo",  
"place":"america"  
}

I can clearly do a faceted search on tags array and get the result i want.  
But then is there any way i can do the same with the first mentioned  
structure.

Thanks  
Vineeth

---

<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:50am UTC](https://discuss.elastic.co/t/facets-and-facet-value-pair/5711/2 "2017-07-06T03:50:34Z")

</div>


