# Visualization doesn't allow "terms" aggreagation

**URL:** <https://discuss.elastic.co/t/visualization-doesnt-allow-terms-aggreagation/117995>\
**Category:** Kibana\
**Created:** [February 1, 2018, 10:32am UTC](https://discuss.elastic.co/t/visualization-doesnt-allow-terms-aggreagation/117995 "2018-02-01T10:32:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Gabay](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@David\_Gabay](https://discuss.elastic.co/u/David_Gabay)\
**Post date:** [February 1, 2018, 10:32am UTC](https://discuss.elastic.co/t/visualization-doesnt-allow-terms-aggreagation/117995/1 "2018-02-01T10:32:20Z")

</div>

I'm trying to produce a tag cloud for a textual field.

I uploaded the data to ES from CSV, then edited the index mapping and created a new index, with "fielddata = true" for the textual fields on which I want to aggregate.

The mapping of the textual fields is as follows:  
//  
PUT demo\_0\_5\_new  
{  
"settings" : {  
"number\_of\_shards" : 1  
},  
"mappings": {  
"doc": {  
...  
"text": {  
"type": "text",  
"fielddata": true  
},  
"text\_no\_stopwords": {  
"type": "text",  
"fielddata": true  
}  
...  
//

With this index, I can perform "terms" aggregation from Kibana's dev-tools tab, using the command:

GET demo\_0\_5\_new/\_search  
{  
"aggs" : {  
"text" : {  
"terms" : { "field" : "text" ,  
"size": 100  
}  
}  
}  
}

This query runs successfully and return the 100 most frequent words.

However, in the "index pattern" tab, the "text" fields is not shown as "aggregateble" , and in the visualize tab, it cannot be selected for the "terms" aggregation.

If the field is not aggregatable, how can is it that I can run a "terms" query via the dev-tools tab? What do I need to do to get a tag-cloud visualization (which requires terms agg) for this fields?

---

<div class="post-metadata">

**Author:** ![aberrantCode](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@aberrantCode](https://discuss.elastic.co/u/aberrantCode)\
**Post date:** [February 1, 2018, 3:29pm UTC](https://discuss.elastic.co/t/visualization-doesnt-allow-terms-aggreagation/117995/2 "2018-02-01T15:29:17Z")

</div>

> [@David\_Gabay](#):
>
> PUT demo\_0\_5\_new
> 
> {
> 
> "settings" : {
> 
> "number\_of\_shards" : 1
> 
> },
> 
> "mappings": {
> 
> "doc": {
> 
> ...
> 
> "text": {
> 
> "type": "text",
> 
> "fielddata": true
> 
> },
> 
> "text\_no\_stopwords": {
> 
> "type": "text",
> 
> "fielddata": true
> 
> }

Try:  
PUT demo\_0\_5\_new  
{  
"settings" : {  
"number\_of\_shards" : 1  
},  
"mappings": {  
"doc": {  
...  
"text": {  
"type": "keyword",  
"fielddata": true  
},  
"text\_no\_stopwords": {  
"type": "text",  
"fielddata": true  
}

---

<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:** [March 1, 2018, 3:29pm UTC](https://discuss.elastic.co/t/visualization-doesnt-allow-terms-aggreagation/117995/3 "2018-03-01T15:29:20Z")

</div>

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