# Update dynamically set mapping using PUT mapping API

**URL:** https://discuss.elastic.co/t/update-dynamically-set-mapping-using-put-mapping-api/23486
**Category:** Elasticsearch
**Created:** [April 30, 2015, 11:42am UTC](https://discuss.elastic.co/t/update-dynamically-set-mapping-using-put-mapping-api/23486 "2015-04-30T11:42:41Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![deepak\_daffodil](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@deepak\_daffodil](https://discuss.elastic.co/u/deepak_daffodil)
#### Post date: [April 30, 2015, 11:42am UTC](https://discuss.elastic.co/t/update-dynamically-set-mapping-using-put-mapping-api/23486/1 "2015-04-30T11:42:41Z")

</div>

Hey everyone ,  
I have stucked over an issue.  
I have an index with the following mapping currently :

"mappings": {  
"product": {  
"dynamic\_templates": [  
{  
"template\_name": {  
"mapping": {  
"type": "string",  
"index": "analyzed",  
"fields": {  
"org": {  
"type": "string",  
"index": "not\_analyzed"  
}  
},  
"index\_analyzer": "indexAnalyzer",  
"search\_analyzer": "standard"  
},  
"match": "\*",  
"match\_mapping\_type": "string"  
}  
}  
]  
}  
}

Now i want to change the analyzer keeping all the other mapping same  
.....i.e. i want to apply same dynamic mapping with diffrent  
"index\_analyzer". i have change settings to define new analyzer , but when  
i PUT mapping i got error.

My command for mapping update is :  
PUT epikkoproduct/product/\_mapping  
{  
"properties": {  
"dynamic\_templates": [  
{  
"template\_name1": {  
"match": "\*",  
"match\_mapping\_type": "string",  
"mapping": {

```
                    "type":"string",
                    "index": "analyzed",
                    "fields": {
                       "org": {
                          "type": "string",
                          "index": "not_analyzed"
                       }
                    },
                    "index_analyzer" :"newindexanalyzer"
                    "search_analyzer" :"standard"
                 }
                
              }
           }
        ]

```

}  
}

this shows following error :

{  
"error": "MapperParsingException[Expected map for property [fields] on  
field [dynamic\_templates] but got a class java.lang.String]",  
"status": 400  
}

Suggest any solutions ASAP

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c22d5fe2-de57-45c1-b394-3431680827f4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c22d5fe2-de57-45c1-b394-3431680827f4%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![divya.dvrj](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@divya.dvrj](https://discuss.elastic.co/u/divya.dvrj)
#### Post date: [June 16, 2017, 5:11pm UTC](https://discuss.elastic.co/t/update-dynamically-set-mapping-using-put-mapping-api/23486/2 "2017-06-16T17:11:51Z")

</div>

Where you able to fix this error ?

---

<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: [November 4, 2022, 4:01am UTC](https://discuss.elastic.co/t/update-dynamically-set-mapping-using-put-mapping-api/23486/3 "2022-11-04T04:01:26Z")

</div>


