# Automatically making text fields aggregatable

**URL:** <https://discuss.elastic.co/t/automatically-making-text-fields-aggregatable/137973>\
**Category:** Elasticsearch\
**Created:** [June 29, 2018, 1:33pm UTC](https://discuss.elastic.co/t/automatically-making-text-fields-aggregatable/137973 "2018-06-29T13:33:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbwest](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dbwest/32/32631_2.png) [@dbwest](https://discuss.elastic.co/u/dbwest)\
**Post date:** [June 29, 2018, 1:33pm UTC](https://discuss.elastic.co/t/automatically-making-text-fields-aggregatable/137973/1 "2018-06-29T13:33:28Z")

</div>

Hi, when we are logging our fields for many things come in as 'Text'. We use the bulk import and ndjson. We want them to be 'Keyword's so they are aggregatable. Is there an automatic way to do this. Currently we pull down the index and change everything manually.

How can we have this done automatically.

---

<div class="post-metadata">

**Author:** ![jalogisch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jalogisch/32/90844_2.png) [@jalogisch](https://discuss.elastic.co/u/jalogisch)\
**Post date:** [July 2, 2018, 10:57am UTC](https://discuss.elastic.co/t/automatically-making-text-fields-aggregatable/137973/2 "2018-07-02T10:57:36Z")

</div>

you want to use a dynamic template / custom mapping for that:

[https://www.elastic.co/guide/en/elasticsearch/reference/5.6/dynamic-templates.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/dynamic-templates.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:** [July 30, 2018, 10:57am UTC](https://discuss.elastic.co/t/automatically-making-text-fields-aggregatable/137973/3 "2018-07-30T10:57:39Z")

</div>

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