# Adding a field analyzer to an existing field creates duplicate

**URL:** <https://discuss.elastic.co/t/adding-a-field-analyzer-to-an-existing-field-creates-duplicate/145950>\
**Category:** Elasticsearch\
**Created:** [August 24, 2018, 5:07pm UTC](https://discuss.elastic.co/t/adding-a-field-analyzer-to-an-existing-field-creates-duplicate/145950 "2018-08-24T17:07:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rtpk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rtpk/32/34803_2.png) [@rtpk](https://discuss.elastic.co/u/rtpk)\
**Post date:** [August 24, 2018, 5:07pm UTC](https://discuss.elastic.co/t/adding-a-field-analyzer-to-an-existing-field-creates-duplicate/145950/1 "2018-08-24T17:07:29Z")

</div>

Hi everyone,

So we just found out that the default analyzer that we are currently using for an index is not doing the job correctly for a specific field. I've looked into adding an analyzer for a specific field and got that to work on a test cluster. To test it, I created a new index from scratch using an index template containing the mapping of the targeted field. Everything worked as expected. Now that I'm working on the production cluster, I changed the index template by adding the mapping of the field and its specific analyzer. The problem I am encountering is that it seems that the fields are being initialized dynamically and I end up with the same field being mapped twice with two different analyzers and two different types as seen below.

`"ScriptBlockText": { "type": "text", "fields": { "keyword": { "type": "keyword", "ignore_above": 256 } } }, "ScriptBlocktText": { "type": "text", "fields": { "keyword": { "type": "text", "analyzer": "whitespace" } } },`

Even after the index rolls over I still get the same issue with having the same field being mapped twice.

Thanks in advance for the help!

---

<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 21, 2018, 5:07pm UTC](https://discuss.elastic.co/t/adding-a-field-analyzer-to-an-existing-field-creates-duplicate/145950/2 "2018-09-21T17:07:33Z")

</div>

Closed on September 21, 2018, 5:07pm UTC

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