# Dynamic mapping with .keyword field

**URL:** <https://discuss.elastic.co/t/dynamic-mapping-with-keyword-field/297449>\
**Category:** Elasticsearch\
**Created:** [February 17, 2022, 7:54am UTC](https://discuss.elastic.co/t/dynamic-mapping-with-keyword-field/297449 "2022-02-17T07:54:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sandeep\_Raju](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@Sandeep\_Raju](https://discuss.elastic.co/u/Sandeep_Raju)\
**Post date:** [February 17, 2022, 7:54am UTC](https://discuss.elastic.co/t/dynamic-mapping-with-keyword-field/297449/1 "2022-02-17T07:54:02Z")

</div>

Hi all, i'm trying to push data with dynamically mapping to indices.

The problem is everytime every string field is taken as text instead of keyword and it later throws an error.

I cannot define mappings as they are pushed dynamically .

Any way to overcome this?

---

<div class="post-metadata">

**Author:** ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)\
**Post date:** [February 20, 2022, 11:12am UTC](https://discuss.elastic.co/t/dynamic-mapping-with-keyword-field/297449/2 "2022-02-20T11:12:26Z")

</div>

It is possible to configure dynamic mappings by [Dynamic templates](https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic-templates.html#match-mapping-type).

---

<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 20, 2022, 11:13am UTC](https://discuss.elastic.co/t/dynamic-mapping-with-keyword-field/297449/3 "2022-03-20T11:13:12Z")

</div>

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