# Aggregations on whole of text field

**URL:** <https://discuss.elastic.co/t/aggregations-on-whole-of-text-field/191793>\
**Category:** Kibana\
**Created:** [July 23, 2019, 10:56am UTC](https://discuss.elastic.co/t/aggregations-on-whole-of-text-field/191793 "2019-07-23T10:56:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jong99](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@jong99](https://discuss.elastic.co/u/jong99)\
**Post date:** [July 23, 2019, 10:56am UTC](https://discuss.elastic.co/t/aggregations-on-whole-of-text-field/191793/1 "2019-07-23T10:56:33Z")

</div>

I have a field that I want to be full-text searchable, so I have it stored as type text.

However I want to be able to run aggregations on the entire contents of the field, so a keyword might be preferred.

How can I set up this field as searchable and aggregatable on the **entire string**? Note, NOT on the words in the string.

I don't believe that fielddata is what I'm after here as that's for the individual words I think.

Thanks! 🙂

---

<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:** [July 23, 2019, 11:51am UTC](https://discuss.elastic.co/t/aggregations-on-whole-of-text-field/191793/2 "2019-07-23T11:51:50Z")

</div>

Hey @jong99,

For something like this, we usually suggest creating a multi-field. Your index will essentially have one entry stored as text, and another stored as keyword. Check out the docs here for multi-field support: [https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-fields.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-fields.html)

---

<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 20, 2019, 11:51am UTC](https://discuss.elastic.co/t/aggregations-on-whole-of-text-field/191793/3 "2019-08-20T11:51:55Z")

</div>

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