# Problem with Term aggregation - Unable to use a specific field

**URL:** https://discuss.elastic.co/t/problem-with-term-aggregation-unable-to-use-a-specific-field/146704
**Category:** Kibana
**Created:** [August 30, 2018, 1:07pm UTC](https://discuss.elastic.co/t/problem-with-term-aggregation-unable-to-use-a-specific-field/146704 "2018-08-30T13:07:10Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![aurelien](https://avatars.discourse-cdn.com/v4/letter/a/67e7ee/32.png) [@aurelien](https://discuss.elastic.co/u/aurelien)
#### Post date: [August 30, 2018, 1:07pm UTC](https://discuss.elastic.co/t/problem-with-term-aggregation-unable-to-use-a-specific-field/146704/1 "2018-08-30T13:07:10Z")

</div>

Hi,

I want to use a simple Term aggregation in a data table but I have a problem with the Field selector. The field that I want to use for aggregation is not in the dropdown list. However, the aggregation works perfectly if I query elasticsearch directly:

> GET /entities/\_search  
> {  
> "size": 0,  
> "aggs": {  
> "category": {  
> "terms": {  
> "field": "Cat\_EN.keyword",  
> "size": 10  
> }  
> }  
> }  
> }

I use the latest version (6.4.0) of ES and Kibana.

Do you have any idea on what is going wrong?

Thank you,

Aurelien

---

<div class="post-metadata">

### Author: ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)
#### Post date: [August 30, 2018, 1:18pm UTC](https://discuss.elastic.co/t/problem-with-term-aggregation-unable-to-use-a-specific-field/146704/2 "2018-08-30T13:18:48Z")

</div>

Is is possible that your index pattern is out-of-date? If your mapping changed after creating the index pattern (for example, if Cat\_EN didn't used to have a "keyword" field), then Kibana won't be aware of that.

Refreshing the index pattern from the management screen might help if that's the case:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/2/f29b326b588a84a7f0c7feaaa0453090479c3213.png)

---

<div class="post-metadata">

### Author: ![aurelien](https://avatars.discourse-cdn.com/v4/letter/a/67e7ee/32.png) [@aurelien](https://discuss.elastic.co/u/aurelien)
#### Post date: [August 30, 2018, 1:22pm UTC](https://discuss.elastic.co/t/problem-with-term-aggregation-unable-to-use-a-specific-field/146704/3 "2018-08-30T13:22:03Z")

</div>

Yes it worked :-). Thank you very much!

---

<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: [September 27, 2018, 1:22pm UTC](https://discuss.elastic.co/t/problem-with-term-aggregation-unable-to-use-a-specific-field/146704/4 "2018-09-27T13:22:04Z")

</div>

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