# How to change the mapping type while reindexing

**URL:** <https://discuss.elastic.co/t/how-to-change-the-mapping-type-while-reindexing/133683>\
**Category:** Elasticsearch\
**Created:** [May 29, 2018, 12:39pm UTC](https://discuss.elastic.co/t/how-to-change-the-mapping-type-while-reindexing/133683 "2018-05-29T12:39:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sureshsubramaniyan](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@sureshsubramaniyan](https://discuss.elastic.co/u/sureshsubramaniyan)\
**Post date:** [May 29, 2018, 12:39pm UTC](https://discuss.elastic.co/t/how-to-change-the-mapping-type-while-reindexing/133683/1 "2018-05-29T12:39:46Z")

</div>

How to change the dynamic mapping type from logs to docs while reindexing

```
    "index_name1_template": {
        "order": 0,
        "index_patterns": [
          "index_name1_v1_*"
        ],
        "settings": {
          "index": {
            "number_of_shards": "3",
            "number_of_replicas": "1"
          }
        },
        "mappings": {
          "logs": {
            "dynamic_templates": [
              {
                "strings_as_keyword": {
                  "mapping": {
                    "ignore_above": 1024,
                    "type": "keyword"
                  },
                  "match_mapping_type": "string"
                }
              }
            ]
          }
        },
        "aliases": {}
      }
    }
```

---

<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:** [June 26, 2018, 12:39pm UTC](https://discuss.elastic.co/t/how-to-change-the-mapping-type-while-reindexing/133683/2 "2018-06-26T12:39:47Z")

</div>

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