# Mapper parsing exception: Root mapping definition has unsupported parameters

**URL:** https://discuss.elastic.co/t/mapper-parsing-exception-root-mapping-definition-has-unsupported-parameters/225449
**Category:** Elasticsearch
**Created:** [March 27, 2020, 5:43pm UTC](https://discuss.elastic.co/t/mapper-parsing-exception-root-mapping-definition-has-unsupported-parameters/225449 "2020-03-27T17:43:18Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![vernal](https://avatars.discourse-cdn.com/v4/letter/v/b38774/32.png) [@vernal](https://discuss.elastic.co/u/vernal)
#### Post date: [March 27, 2020, 5:43pm UTC](https://discuss.elastic.co/t/mapper-parsing-exception-root-mapping-definition-has-unsupported-parameters/225449/1 "2020-03-27T17:43:18Z")

</div>

PUT /ag2\_vehicle\_stats  
{  
"settings": {  
"number\_of\_shards": 1  
},  
"mappings": {  
"doc": {  
"properties": {  
"vin": {  
"type": "keyword"  
},  
"error\_reported": {  
"type": "integer"  
},  
"num\_records": {  
"type": "integer"  
},  
"start\_time": {  
"type": "date",  
"format": "yyyy-MM-dd HH:mm:ss"  
},  
"end\_time": {  
"type": "date",  
"format": "yyyy-MM-dd HH:mm:ss"  
},  
"num\_days": {  
"type": "integer"  
}  
}  
}  
}  
}

Then, I got the following error msg:  
{  
"error" : {  
"root\_cause" : [  
{  
"type" : "mapper\_parsing\_exception",  
"reason" : "Root mapping definition has unsupported parameters: [doc : {properties={odo\_index={type=integer}, battery\_usage\_high={type=integer}, daily\_fuel\_dist\_p99={type=double}, num\_records={type=integer}, new\_seg\_battery\_drive\_energy\_capacity\_in\_kwh={type=double}, cell\_volt\_diff\_drive\_mean\_now={type=double}, city\_last\_day={type=keyword}, battery\_life\_in\_days={type=integer}, total\_distance\_on\_battery={type=integer}, daily\_batt\_dist\_p99={type=double}, daily\_charge\_energy\_avg\_in\_kwh={type=double}, num\_days={type=integer}}}]"  
}  
],  
"type" : "mapper\_parsing\_exception",  
"reason" : "Failed to parse mapping [\_doc]: Root mapping definition has unsupported parameters: [doc : {properties={odo\_index={type=integer}, battery\_usage\_high={type=integer}, daily\_fuel\_dist\_p99={type=double}, num\_records={type=integer}, new\_seg\_battery\_drive\_energy\_capacity\_in\_kwh={type=double}, cell\_volt\_diff\_drive\_mean\_now={type=double}, city\_last\_day={type=keyword}, battery\_life\_in\_days={type=integer}, total\_distance\_on\_battery={type=integer}, daily\_batt\_dist\_p99={type=double}, daily\_charge\_energy\_avg\_in\_kwh={type=double}, num\_days={type=integer}}}]",  
"caused\_by" : {  
"type" : "mapper\_parsing\_exception",  
"reason" : "Root mapping definition has unsupported parameters: [doc : {properties={odo\_index={type=integer}, battery\_usage\_high={type=integer}, daily\_fuel\_dist\_p99={type=double}, num\_records={type=integer}, new\_seg\_battery\_drive\_energy\_capacity\_in\_kwh={type=double}, cell\_volt\_diff\_drive\_mean\_now={type=double}, city\_last\_day={type=keyword}, battery\_life\_in\_days={type=integer}, total\_distance\_on\_battery={type=integer}, daily\_batt\_dist\_p99={type=double}, daily\_charge\_energy\_avg\_in\_kwh={type=double}, num\_days={type=integer}}}]"  
}  
},  
"status" : 400  
}

What's wrong here?

---

<div class="post-metadata">

### Author: ![vernal](https://avatars.discourse-cdn.com/v4/letter/v/b38774/32.png) [@vernal](https://discuss.elastic.co/u/vernal)
#### Post date: [March 27, 2020, 6:13pm UTC](https://discuss.elastic.co/t/mapper-parsing-exception-root-mapping-definition-has-unsupported-parameters/225449/2 "2020-03-27T18:13:15Z")

</div>

I have changed "doc" to "\_doc" and got new error as below:

The mapping definition cannot be nested under a type [\_doc] unless include\_type\_name is set to true

---

<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 27, 2020, 6:54pm UTC](https://discuss.elastic.co/t/mapper-parsing-exception-root-mapping-definition-has-unsupported-parameters/225449/3 "2020-03-27T18:54:58Z")

</div>

Remove it entirely.

---

<div class="post-metadata">

### Author: ![vernal](https://avatars.discourse-cdn.com/v4/letter/v/b38774/32.png) [@vernal](https://discuss.elastic.co/u/vernal)
#### Post date: [March 30, 2020, 10:46pm UTC](https://discuss.elastic.co/t/mapper-parsing-exception-root-mapping-definition-has-unsupported-parameters/225449/4 "2020-03-30T22:46:32Z")

</div>

Thank you for the help David. It solved my problem.

Now another issue here:

I tried to put the command in python code to automate the process:  
`curl -H Content-Type:application/json --user admin:dev -XPUT localhost:9200/ag2_vehicle_stats-2020-03-23 -d @/home/elk-daily-updates/ag2_vehicle_stats.json`

However, I got the following error msg:  
"took" : 59303,  
"errors" : true,  
"items" : [  
{  
"index" : {  
"\_index" : "ag2\_vehicle\_stats-2020-03-23",  
"\_type" : "doc",  
"\_id" : "Nz0aHnEBZhYEtxZotiMK",  
"status" : 400,  
"error" : {  
"type" : "illegal\_argument\_exception",  
"reason" : "Rejecting mapping update to [ag2\_vehicle\_stats-2020-03-23] as the final mapping would have more than 1 type: [\_doc, doc]"  
}  
}  
}

What is wrong with the command above?

---

<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 31, 2020, 12:16am UTC](https://discuss.elastic.co/t/mapper-parsing-exception-root-mapping-definition-has-unsupported-parameters/225449/5 "2020-03-31T00:16:34Z")

</div>

.

Most likely your json file is using `doc` instead of `_doc` as the type name.

---

<div class="post-metadata">

### Author: ![vernal](https://avatars.discourse-cdn.com/v4/letter/v/b38774/32.png) [@vernal](https://discuss.elastic.co/u/vernal)
#### Post date: [March 31, 2020, 2:07am UTC](https://discuss.elastic.co/t/mapper-parsing-exception-root-mapping-definition-has-unsupported-parameters/225449/6 "2020-03-31T02:07:55Z")

</div>

Yeah, it works now.

Thanks for your help, David!

---

<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 28, 2020, 2:07am UTC](https://discuss.elastic.co/t/mapper-parsing-exception-root-mapping-definition-has-unsupported-parameters/225449/7 "2020-04-28T02:07:58Z")

</div>

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