# Mapper parser exception when creating an index with mapping

**URL:** https://discuss.elastic.co/t/mapper-parser-exception-when-creating-an-index-with-mapping/235833
**Category:** Elasticsearch
**Created:** [June 4, 2020, 6:10pm UTC](https://discuss.elastic.co/t/mapper-parser-exception-when-creating-an-index-with-mapping/235833 "2020-06-04T18:10:56Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Sesha\_Sai\_Suhash\_Des](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sesha_sai_suhash_des/32/46276_2.png) [@Sesha\_Sai\_Suhash\_Des](https://discuss.elastic.co/u/Sesha_Sai_Suhash_Des)
#### Post date: [June 4, 2020, 6:10pm UTC](https://discuss.elastic.co/t/mapper-parser-exception-when-creating-an-index-with-mapping/235833/1 "2020-06-04T18:10:56Z")

</div>

I am getting error when running the following command. I am a noob please help me.  
**command :**  
`PUT /companydatabase?pretty { "mappings": { "employees": { "properties": { "FirstName": { "type": "text" }, "LastName": { "type": "text" }, "Designation": { "type": "text" }, "Salary": { "type": "integer" }, "DateOfJoining": { "type": "date", "format": "yyyy-MM-dd" }, "Address": { "type": "text" }, "Gender": { "type": "text" }, "Age": { "type": "integer" }, "MaritalStatus": { "type": "text" }, "Interests": { "type": "text" } } } } }`

**The error :**  
`{ "error" : { "root_cause" : [{ "type" : "mapper_parsing_exception", "reason" : "Root mapping definition has unsupported parameters: [employees : {properties={Designation={type=text}, Salary={type=integer}, MaritalStatus={type=text}, DateOfJoining={format=yyyy-MM-dd, type=date}, Address={type=text}, FirstName={type=text}, LastName={type=text}, Gender={type=text}, Age={type=integer}, Interests={type=text}}}]" } ], "type" : "mapper_parsing_exception", "reason" : "Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters: [employees : {properties={Designation={type=text}, Salary={type=integer}, MaritalStatus={type=text}, DateOfJoining={format=yyyy-MM-dd, type=date}, Address={type=text}, FirstName={type=text}, LastName={type=text}, Gender={type=text}, Age={type=integer}, Interests={type=text}}}]", "caused_by" : { "type" : "mapper_parsing_exception", "reason" : "Root mapping definition has unsupported parameters: [employees : {properties={Designation={type=text}, Salary={type=integer}, MaritalStatus={type=text}, DateOfJoining={format=yyyy-MM-dd, type=date}, Address={type=text}, FirstName={type=text}, LastName={type=text}, Gender={type=text}, Age={type=integer}, Interests={type=text}}}]" } }, "status" : 400 }`

---

<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: [June 4, 2020, 7:28pm UTC](https://discuss.elastic.co/t/mapper-parser-exception-when-creating-an-index-with-mapping/235833/2 "2020-06-04T19:28:15Z")

</div>

Welcome!

I guess you're on 7.x.

Remove `employees` as types have been removed.

---

<div class="post-metadata">

### Author: ![Sesha\_Sai\_Suhash\_Des](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sesha_sai_suhash_des/32/46276_2.png) [@Sesha\_Sai\_Suhash\_Des](https://discuss.elastic.co/u/Sesha_Sai_Suhash_Des)
#### Post date: [June 9, 2020, 9:39am UTC](https://discuss.elastic.co/t/mapper-parser-exception-when-creating-an-index-with-mapping/235833/3 "2020-06-09T09:39:20Z")

</div>

I am sorry. I don't understand.  
Should I remove employees?

---

<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: [June 9, 2020, 10:03am UTC](https://discuss.elastic.co/t/mapper-parser-exception-when-creating-an-index-with-mapping/235833/4 "2020-06-09T10:03:26Z")

</div>

You should remove the `employees` key from your json.

```
PUT /companydatabase
{ "mappings": { "properties": { "FirstName": { "type": "text" }, "LastName": { "type": "text" }, "Designation": { "type": "text" }, "Salary": { "type": "integer" }, "DateOfJoining": { "type": "date", "format": "yyyy-MM-dd" }, "Address": { "type": "text" }, "Gender": { "type": "text" }, "Age": { "type": "integer" }, "MaritalStatus": { "type": "text" }, "Interests": { "type": "text" } } } }
```

---

<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: [July 7, 2020, 10:03am UTC](https://discuss.elastic.co/t/mapper-parser-exception-when-creating-an-index-with-mapping/235833/5 "2020-07-07T10:03:29Z")

</div>

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