# Aggs terms is support \*?

**URL:** <https://discuss.elastic.co/t/aggs-terms-is-support/21253>\
**Category:** Elasticsearch\
**Created:** [December 15, 2014, 6:26am UTC](https://discuss.elastic.co/t/aggs-terms-is-support/21253 "2014-12-15T06:26:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.elastic.co/u/11175)\
**Post date:** [December 15, 2014, 6:26am UTC](https://discuss.elastic.co/t/aggs-terms-is-support/21253/1 "2014-12-15T06:26:30Z")

</div>

I have a scene.

* * *

Data A  
{  
name:"foodA",  
props:{  
color: "red",  
taste: "sweet",  
xx: xx,  
xx: xx  
}  
}

Date B  
{  
name:"foodB",  
props:{  
color: "black",  
taste: "sweet",  
xx: xx,  
xx: xx  
}  
}

the props field is dynamic, is custom.

* * *

i want result data is

{  
"aggregation": {  
color: [  
{key:"red", count: 1},  
{key:"black", count: 1}  
],  
xx: [  
{key:"xx", count: xx},  
]  
}  
}

* * *

i use the dsl  
{  
"aggs": {  
"all": {  
"terms": {  
"field": "props.\*"  
}  
}  
}  
}

but return nothing. i don't konw how to do

--  
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/7f62cfb3-bd7b-4831-b29a-824f04a71422%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7f62cfb3-bd7b-4831-b29a-824f04a71422%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [December 15, 2014, 12:11pm UTC](https://discuss.elastic.co/t/aggs-terms-is-support/21253/2 "2014-12-15T12:11:53Z")

</div>

Hi,

Terms aggregations do not support wildcards, they can only run on a single  
field. In order to do this, you would need to concatenate all your field  
values in a single field at indexing time.

On Mon, Dec 15, 2014 at 7:26 AM, 唐坤 [binlaniua@gmail.com](mailto:binlaniua@gmail.com) wrote:

> I have a scene.
> 
> * * *
> 
> Data A  
> {  
> name:"foodA",  
> props:{  
> color: "red",  
> taste: "sweet",  
> xx: xx,  
> xx: xx  
> }  
> }
> 
> Date B  
> {  
> name:"foodB",  
> props:{  
> color: "black",  
> taste: "sweet",  
> xx: xx,  
> xx: xx  
> }  
> }
> 
> the props field is dynamic, is custom.
> 
> * * *
> 
> i want result data is
> 
> {  
> "aggregation": {  
> color: [  
> {key:"red", count: 1},  
> {key:"black", count: 1}  
> ],  
> xx: [  
> {key:"xx", count: xx},  
> ]  
> }  
> }
> 
> * * *
> 
> i use the dsl  
> {  
> "aggs": {  
> "all": {  
> "terms": {  
> "field": "props.\*"  
> }  
> }  
> }  
> }
> 
> but return nothing. i don't konw how to do
> 
> --  
> 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/7f62cfb3-bd7b-4831-b29a-824f04a71422%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7f62cfb3-bd7b-4831-b29a-824f04a71422%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/7f62cfb3-bd7b-4831-b29a-824f04a71422%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/7f62cfb3-bd7b-4831-b29a-824f04a71422%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Adrien Grand

--  
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/CAL6Z4j6GZmyYttCRLkKROtpde-u2G8XysT771sE4SBgbPKtCBw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6GZmyYttCRLkKROtpde-u2G8XysT771sE4SBgbPKtCBw%40mail.gmail.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, 12:43am UTC](https://discuss.elastic.co/t/aggs-terms-is-support/21253/3 "2017-07-06T00:43:43Z")

</div>


