# Elasticsearch problem when update mapping

**URL:** <https://discuss.elastic.co/t/elasticsearch-problem-when-update-mapping/300197>\
**Category:** Elasticsearch\
**Created:** [March 21, 2022, 11:28am UTC](https://discuss.elastic.co/t/elasticsearch-problem-when-update-mapping/300197 "2022-03-21T11:28:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muhammad\_Fhadli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/muhammad_fhadli/32/102950_2.png) [@Muhammad\_Fhadli](https://discuss.elastic.co/u/Muhammad_Fhadli)\
**Post date:** [March 21, 2022, 11:28am UTC](https://discuss.elastic.co/t/elasticsearch-problem-when-update-mapping/300197/1 "2022-03-21T11:28:14Z")

</div>

I want add mapping to synonym analyzer by perform this operation

```auto
PUT /my_index/_mapping/items
{
      "items": {
        "properties": {
          "judul": {
            "type": "text",
            "analyzer": "synonym"
          }
        }
      }
}

```

But, I got this error

```auto
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "Mapper for [judul] conflicts with existing mapping in other types:\n[mapper [judul] has different [analyzer]]"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "Mapper for [judul] conflicts with existing mapping in other types:\n[mapper [judul] has different [analyzer]]"
  },
  "status": 400
}

```

Here is my `localhost:9200/my_index/_mapping/`

```auto
{
  "my_index": {
    "mappings": {
      "items": {
        "properties": {
          .
          .
          .
          "judul": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          .
          .
          .
        }
      }
    }
  }
}

```

Can someone help me with this problem?  
Please feel free to comment if you need more information, since I'm not really sure what else should i add in this description. Thank you

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 21, 2022, 11:42am UTC](https://discuss.elastic.co/t/elasticsearch-problem-when-update-mapping/300197/2 "2022-03-21T11:42:21Z")

</div>

You can't update an existing field and change the `analyzer`.

You need to DELETE the index and create it again.

---

<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:** [April 18, 2022, 11:43am UTC](https://discuss.elastic.co/t/elasticsearch-problem-when-update-mapping/300197/3 "2022-04-18T11:43:06Z")

</div>

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