# Visualize buckets by using text fields

**URL:** <https://discuss.elastic.co/t/visualize-buckets-by-using-text-fields/260646>\
**Category:** Kibana\
**Created:** [January 10, 2021, 2:41pm UTC](https://discuss.elastic.co/t/visualize-buckets-by-using-text-fields/260646 "2021-01-10T14:41:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![imaneg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/imaneg/32/80166_2.png) [@imaneg](https://discuss.elastic.co/u/imaneg)\
**Post date:** [January 10, 2021, 2:41pm UTC](https://discuss.elastic.co/t/visualize-buckets-by-using-text-fields/260646/1 "2021-01-10T14:41:27Z")

</div>

Hello,  
I would like to visualize buckets by using text fields rather than keywords. For doing this I enabled `fielddata` on the targeted text field. I am able to see the results when I am running the aggregation from dev tools. However, I am wondering how could I run it on Visualize, as I am unable to change the fields list?  
Many thanks in advance.

---

<div class="post-metadata">

**Author:** ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)\
**Post date:** [January 11, 2021, 11:07am UTC](https://discuss.elastic.co/t/visualize-buckets-by-using-text-fields/260646/2 "2021-01-11T11:07:15Z")

</div>

Hi, what if you update the mapping of your text adding also a `keyword` type, and use that on your visualization?

> **[Text field type | Elasticsearch Reference \[7.10\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/text.html#before-enabling-fielddata)**

---

<div class="post-metadata">

**Author:** ![imaneg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/imaneg/32/80166_2.png) [@imaneg](https://discuss.elastic.co/u/imaneg)\
**Post date:** [January 11, 2021, 2:07pm UTC](https://discuss.elastic.co/t/visualize-buckets-by-using-text-fields/260646/3 "2021-01-11T14:07:04Z")

</div>

Hello,  
Thank you so much for your answer.  
My field is already a keyword and text.  
My concern is how to aggregate on the text in the visualisation. I am able to do it on dev tools but not on visualize.

---

<div class="post-metadata">

**Author:** ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)\
**Post date:** [January 11, 2021, 3:16pm UTC](https://discuss.elastic.co/t/visualize-buckets-by-using-text-fields/260646/4 "2021-01-11T15:16:34Z")

</div>

Can you describe your use case so I can describe which visualization tool is better to use for your case?

---

<div class="post-metadata">

**Author:** ![imaneg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/imaneg/32/80166_2.png) [@imaneg](https://discuss.elastic.co/u/imaneg)\
**Post date:** [January 12, 2021, 6:01pm UTC](https://discuss.elastic.co/t/visualize-buckets-by-using-text-fields/260646/5 "2021-01-12T18:01:59Z")

</div>

Hello markov,  
Sorry for my late reply.  
I have documents including a set of sentences and I'd like to have the most significant words from all the document. It could be done using an aggregation. As the aggregations only work on keywords, I used fielddata ([https://www.elastic.co/guide/en/elasticsearch/reference/current/text.html#enable-fielddata-text-fields](https://www.elastic.co/guide/en/elasticsearch/reference/current/text.html#enable-fielddata-text-fields)) for enabling aggregation of text fields. However, now, I would like to do visualize that (vertical/ horizontal bar). The problem is that Kibana gives me only the possibility to select field.keyword. Example, if my field is `content`, I am unable to select bucket aggregation (inside visualize) on the `content`. I have only `content.keyword` as option.  
Hope it is clear.  
Many thanks.  
Best regards.

---

<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:** [February 9, 2021, 6:02pm UTC](https://discuss.elastic.co/t/visualize-buckets-by-using-text-fields/260646/6 "2021-02-09T18:02:13Z")

</div>

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