# Cannot update field mapping with custom normalizer

**URL:** <https://discuss.elastic.co/t/cannot-update-field-mapping-with-custom-normalizer/280782>\
**Category:** Elasticsearch\
**Created:** [August 9, 2021, 9:14am UTC](https://discuss.elastic.co/t/cannot-update-field-mapping-with-custom-normalizer/280782 "2021-08-09T09:14:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rammi22](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@Rammi22](https://discuss.elastic.co/u/Rammi22)\
**Post date:** [August 9, 2021, 9:14am UTC](https://discuss.elastic.co/t/cannot-update-field-mapping-with-custom-normalizer/280782/1 "2021-08-09T09:14:25Z")

</div>

Trying to extends a field mapper returns exception...

The field:

```auto
...
"detail.data.myfield": {
    "type": "text",
    "fields": {
        "keyword": {
            "type": "keyword",
            "ignore_above": 256
        },
        "wildcard_field": {
            "type": "wildcard"
        }
    }
},
....

```

**first** try:

```auto
// the query with curl
curl -X PUT "http://127.0.0.1:9200/myindex/_mapping?pretty" -H 'Content-Type: application/json' -d'
{
    "properties":{
        "data.detail.myfield":{
             "type":"text", "fields":{
                   "keyword":{
                      "type":"keyword", "normalizer":"strtolower"
                   }
              }
          }
     }
}'

```

Exception:  
`Mapper for [data.detail.myfield.keyword] conflicts with existing mapper:\n\tCannot update parameter [normalizer] from [null] to [strtolower]`

**second** try

```auto
curl -X PUT "http://127.0.0.1:9200/myindex/_mapping?pretty" -H 'Content-Type: application/json' -d'
{
    "properties":{
         "data.detail.myfield.keyword": { 
             "type":"keyword", "normalizer":"strtolower" 
         }
    }
}'

```

Exception:

```auto
{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "can't merge a non object mapping [data.detail.myfield] with an object mapping"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "can't merge a non object mapping [data.detail.myfield] with an object mapping"
  },
  "status" : 400
}

```

How to use the mapping api to **add a custom normalizer to existing field**?

---

<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 6, 2021, 9:14am UTC](https://discuss.elastic.co/t/cannot-update-field-mapping-with-custom-normalizer/280782/2 "2021-09-06T09:14:31Z")

</div>

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