# Error when creating different Type in Same Index Name

**URL:** <https://discuss.elastic.co/t/error-when-creating-different-type-in-same-index-name/136078>\
**Category:** Elasticsearch\
**Created:** [June 15, 2018, 10:04am UTC](https://discuss.elastic.co/t/error-when-creating-different-type-in-same-index-name/136078 "2018-06-15T10:04:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RakshaChoudhary](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@RakshaChoudhary](https://discuss.elastic.co/u/RakshaChoudhary)\
**Post date:** [June 15, 2018, 10:04am UTC](https://discuss.elastic.co/t/error-when-creating-different-type-in-same-index-name/136078/1 "2018-06-15T10:04:20Z")

</div>

Hi all,

I am trying to create a new Type in same Index as below.

I already have created a index like below, which has more than 200 data.

post \_bulk  
{"index":{"\_index" : "bank", "\_type" : "account", "\_id":"1"}}  
{"account\_number":1,"balance":39225,"firstname":"Amber","lastname":"Duke","age":32,"gender":"M","address":"880 Holmes [Lane","employer":"Pyrami","email":"amberduke@pyrami.com](mailto:Lane%22,%22employer%22:%22Pyrami%22,%22email%22:%22amberduke@pyrami.com)","city":"Brogan","state":"IL"}

Because I am just learning elasticsearch query, so wanted to work on lesser data. So I thought of creating the same index with different Type name (with same data , just 10-15 row of data)

post \_bulk  
{"index":{"\_index" : "bank", "\_type" : " **fewaccounts**", "\_id":"1"}}  
{"account\_number":1,"balance":39225,"firstname":"Amber","lastname":"Duke","age":32,"gender":"M","address":"880 Holmes [Lane","employer":"Pyrami","email":"amberduke@pyrami.com](mailto:Lane%22,%22employer%22:%22Pyrami%22,%22email%22:%22amberduke@pyrami.com)","city":"Brogan","state":"IL"}

When trying to run above query, getting error as below

"index": {  
"\_index": "bank",  
"\_type": "fewaccounts",  
"\_id": "6",  
"status": 400,  
"error": {  
"type": "illegal\_argument\_exception",  
"reason": "Rejecting mapping update to [bank] as the final mapping would have more than 1 type: [fewaccounts, account]"

I know for learning purpose , i can create a new index and new type. But I would like to know why am I getting this error, and how to fix it.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 15, 2018, 10:14am UTC](https://discuss.elastic.co/t/error-when-creating-different-type-in-same-index-name/136078/2 "2018-06-15T10:14:53Z")

</div>

From version 6.0, it is no longer possible to have more than one type in a newly created index. The reason for this is that types are being deprecated.

---

<div class="post-metadata">

**Author:** ![RakshaChoudhary](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@RakshaChoudhary](https://discuss.elastic.co/u/RakshaChoudhary)\
**Post date:** [June 15, 2018, 10:18am UTC](https://discuss.elastic.co/t/error-when-creating-different-type-in-same-index-name/136078/3 "2018-06-15T10:18:06Z")

</div>

oh ok.. I am using version 6.2

That means Its not at all possible to create more than one type for same Index.

Thanks a lot christian for the quick reply.

---

<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 13, 2018, 10:18am UTC](https://discuss.elastic.co/t/error-when-creating-different-type-in-same-index-name/136078/4 "2018-07-13T10:18:07Z")

</div>

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