# About facet, for some dynamic fields(fields we don't know their names)

**URL:** <https://discuss.elastic.co/t/about-facet-for-some-dynamic-fields-fields-we-dont-know-their-names/13918>\
**Category:** Elasticsearch\
**Created:** [October 11, 2013, 9:03am UTC](https://discuss.elastic.co/t/about-facet-for-some-dynamic-fields-fields-we-dont-know-their-names/13918 "2013-10-11T09:03:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seven\_Q](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seven_q/32/2050_2.png) [@Seven\_Q](https://discuss.elastic.co/u/Seven_Q)\
**Post date:** [October 11, 2013, 9:03am UTC](https://discuss.elastic.co/t/about-facet-for-some-dynamic-fields-fields-we-dont-know-their-names/13918/1 "2013-10-11T09:03:41Z")

</div>

Here is the json:  
{ "id": "100004",  
"description": "some description",  
"brand": "brand",  
"displayName": "product",  
"customProperties": {  
"property1": "value1",  
"property2": "value2" ....  
}  
}  
child elements of "customProperties" could be added any time, and we can't  
know the names.  
So,I want to facet all of them one time.  
Is there any solutions? I can't find anything about that, can Elasticsearch  
support that right now?  
Thanks!!!

--  
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:** ![javanna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javanna/32/4698_2.png) [@javanna](https://discuss.elastic.co/u/javanna)\
**Post date:** [October 14, 2013, 9:07am UTC](https://discuss.elastic.co/t/about-facet-for-some-dynamic-fields-fields-we-dont-know-their-names/13918/2 "2013-10-14T09:07:48Z")

</div>

You can facet on multiple fields at the same time, which results in merging  
values coming from different fields into the same facet.  
But you do need to know their names, and specify them when asking for the  
facet.

"facets" : {  
"property" : {  
"terms" : {  
"fields" : ["customProperties.property1", "customProperties.property2"],  
"size" : 10  
}  
}  
}

On Friday, October 11, 2013 11:03:41 AM UTC+2, Seven Q wrote:

> Here is the json:  
> { "id": "100004",  
> "description": "some description",  
> "brand": "brand",  
> "displayName": "product",  
> "customProperties": {  
> "property1": "value1",  
> "property2": "value2" ....  
> }  
> }  
> child elements of "customProperties" could be added any time, and we  
> can't know the names.  
> So,I want to facet all of them one time.  
> Is there any solutions? I can't find anything about that, can  
> Elasticsearch support that right now?  
> Thanks!!!

--  
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:12am UTC](https://discuss.elastic.co/t/about-facet-for-some-dynamic-fields-fields-we-dont-know-their-names/13918/3 "2017-07-06T02:12:37Z")

</div>


