# Resolved - \[ES7.0\]Terms aggregration doesn;t aggregrate by individual values

**URL:** https://discuss.elastic.co/t/resolved-es7-0-terms-aggregration-doesn-t-aggregrate-by-individual-values/190367
**Category:** Elasticsearch
**Created:** [July 14, 2019, 1:39am UTC](https://discuss.elastic.co/t/resolved-es7-0-terms-aggregration-doesn-t-aggregrate-by-individual-values/190367 "2019-07-14T01:39:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![cheriemilk](https://avatars.discourse-cdn.com/v4/letter/c/c37758/32.png) [@cheriemilk](https://discuss.elastic.co/u/cheriemilk)
#### Post date: [July 14, 2019, 1:39am UTC](https://discuss.elastic.co/t/resolved-es7-0-terms-aggregration-doesn-t-aggregrate-by-individual-values/190367/1 "2019-07-14T01:39:49Z")

</div>

[  
cheriemilk](https://discuss.elastic.co/u/cheriemilk)

[2](https://discuss.elastic.co/t/terms-aggregration-doesn-t-aggregrate-by-individual-values-in-array/190366#)

[2m](https://discuss.elastic.co/t/terms-aggregration-doesn-t-aggregrate-by-individual-values-in-array/190366)

Hi team,  
I am running into an issue in ELK production environment and can’t figure out why googled. The google result is saying that it might because the ktf1.raw field not enabled. But I still failed after apply the raw field. Can you help have a look and advice?

Issue Description:

1. I have below data in elk, the value for ktf1, kf1, kf2, ktf3 are arrays. In Kibana, I want the it aggregate by the values in the array. But I didn’t get the expected result. It treat the array as a string, and aggregrate based on the string. Please refer to the screenshot in point3 .

2. **The**** index template** definition for ktf1, kf1, kf2, ktf3 are below.

3. Screenshot of Terms aggregration

---

<div class="post-metadata">

### Author: ![abdon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdon/32/9195_2.png) [@abdon](https://discuss.elastic.co/u/abdon)
#### Post date: [July 15, 2019, 9:50am UTC](https://discuss.elastic.co/t/resolved-es7-0-terms-aggregration-doesn-t-aggregrate-by-individual-values/190367/2 "2019-07-15T09:50:28Z")

</div>

Instead of indexing a string with an array of values like this:

`"[performance,compensation]"`

You need to index an array of string values like this:

`["performance","compensation"]`

---

<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: [August 12, 2019, 9:50am UTC](https://discuss.elastic.co/t/resolved-es7-0-terms-aggregration-doesn-t-aggregrate-by-individual-values/190367/3 "2019-08-12T09:50:35Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
