# ES create index mapping inconsistent with template(keyword type was replaced by text)

**URL:** <https://discuss.elastic.co/t/es-create-index-mapping-inconsistent-with-template-keyword-type-was-replaced-by-text/146931>\
**Category:** Elasticsearch\
**Created:** [September 1, 2018, 3:14am UTC](https://discuss.elastic.co/t/es-create-index-mapping-inconsistent-with-template-keyword-type-was-replaced-by-text/146931 "2018-09-01T03:14:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZedYeung](https://avatars.discourse-cdn.com/v4/letter/z/a88e4f/32.png) [@ZedYeung](https://discuss.elastic.co/u/ZedYeung)\
**Post date:** [September 1, 2018, 3:14am UTC](https://discuss.elastic.co/t/es-create-index-mapping-inconsistent-with-template-keyword-type-was-replaced-by-text/146931/1 "2018-09-01T03:14:58Z")

</div>

ES 5.6, Centos 7  
Here is the example: above is index template, the bottom is the created index mapping.  
Noticed that the field with keyword type is replaced by the text type with keyword filelds.

```auto
{
  "aliases": {
    "analytics": {},
    "analytics_meta": {}
  },
  "mappings": {
    "_default_": {
      "_all": {
        "enabled": false
      },
      "date_detection": false,
      "dynamic": "strict",
      "numeric_detection": false,
      "properties": {}
    },
    "pipelineHeartbeat_v2016012400": {
      "_all": {
        "enabled": false
      },
      "date_detection": false,
      "dynamic": "strict",
      "dynamic_templates": [],
      "numeric_detection": false,
      "properties": {
        "@timestamp": {
          "index": false,
          "store": false,
          "type": "date"
        },
        "buildVersion": {
          "doc_values": true,
          "index": true,
          "type": "keyword"
        },
        "header": {
          "dynamic": "strict",
          "properties": {
            "indexTimestamp": {
              "doc_values": true,
              "format": "date_optional_time",
              "type": "date"
            },
            "location": {
              "doc_values": true,
              "index": true,
              "type": "keyword"
            },
            "messageType": {
              "doc_values": true,
              "index": true,
              "type": "keyword"
            },
            "messageVersion": {
              "doc_values": true,
              "index": true,
              "type": "keyword"
            },
            "pipeline": {
              "doc_values": true,
              "index": true,
              "type": "keyword"
            }
          }
        },
        "source": {
          "doc_values": true,
          "ignore_above": 128,
          "index": true,
          "type": "keyword"
        }
      }
    }
  },
  "settings": {
    "index.mapper.dynamic": false,
    "index.mapping.coerce": false,
    "number_of_replicas": "1",
    "number_of_shards": "3",
    "routing.allocation.total_shards_per_node": "3"
  },
  "template": "analytics_meta_v*"
}

```

```auto
{
    "analytics_meta_v17-2018.08": {
        "aliases": {
            "all_data-2018.08": {},
            "analytics-2018.08": {},
            "analytics_meta-2018.08": {}
        },
        "mappings": {
            "pipelineHeartbeat_v2016012400": {
                "properties": {
                    "@timestamp": {
                        "type": "date"
                    },
                    "buildVersion": {
                        "type": "text",
                        "fields": {
                            "keyword": {
                                "type": "keyword",
                                "ignore_above": 256
                            }
                        }
                    },
                    "header": {
                        "properties": {
                            "indexTimestamp": {
                                "type": "date"
                            },
                            "location": {
                                "type": "text",
                                "fields": {
                                    "keyword": {
                                        "type": "keyword",
                                        "ignore_above": 256
                                    }
                                }
                            },
                            "messageType": {
                                "type": "text",
                                "fields": {
                                    "keyword": {
                                        "type": "keyword",
                                        "ignore_above": 256
                                    }
                                }
                            },
                            "messageVersion": {
                                "type": "text",
                                "fields": {
                                    "keyword": {
                                        "type": "keyword",
                                        "ignore_above": 256
                                    }
                                }
                            },
                            "pipeline": {
                                "type": "text",
                                "fields": {
                                    "keyword": {
                                        "type": "keyword",
                                        "ignore_above": 256
                                    }
                                }
                            }
                        }
                    },
                    "source": {
                        "type": "text",
                        "fields": {
                            "keyword": {
                                "type": "keyword",
                                "ignore_above": 256
                            }
                        }
                    }
                }
            }
        },
        "settings": {
            "index": {
                "number_of_shards": "5",
                "provided_name": "analytics_meta_v17-2018.08",
                "creation_date": "1533079858882",
                "unassigned": {
                    "node_left": {
                        "delayed_timeout": "1m"
                    }
                },
                "number_of_replicas": "1",
                "uuid": "_mLVHf8UTByRRtUkrmj6Fg",
                "version": {
                    "created": "5061099",
                    "upgraded": "5061199"
                }
            }
        }
    }
}

```

---

<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:** [September 29, 2018, 3:15am UTC](https://discuss.elastic.co/t/es-create-index-mapping-inconsistent-with-template-keyword-type-was-replaced-by-text/146931/2 "2018-09-29T03:15:07Z")

</div>

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