Elasticsearch problem when update mapping

I want add mapping to synonym analyzer by perform this operation

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

But, I got this error

{
  "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/

{
  "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

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

You need to DELETE the index and create it again.

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