# Rejecting mapping update to \[test\] as the final mapping would have more than 1 type: \[type1, doc\]

**URL:** <https://discuss.elastic.co/t/rejecting-mapping-update-to-test-as-the-final-mapping-would-have-more-than-1-type-type1-doc/110997>\
**Category:** Elasticsearch\
**Created:** [December 11, 2017, 4:23am UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-test-as-the-final-mapping-would-have-more-than-1-type-type1-doc/110997 "2017-12-11T04:23:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)\
**Post date:** [December 11, 2017, 4:23am UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-test-as-the-final-mapping-would-have-more-than-1-type-type1-doc/110997/1 "2017-12-11T04:23:30Z")

</div>

Hello,

I'm following [Removal of mapping types | Elasticsearch Reference [6.0] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html), by creating new index with single type of document and trying to perform \_reindex:

My elasticsearch has index with \_type: type1 and while using \_reindex, I got following error:

> "failures": [  
> {  
> "index": "test",  
> "type": "type1",  
> "id": "X",  
> "cause": {  
> "type": "illegal\_argument\_exception",  
> "reason": "Rejecting mapping update to [test] as the final mapping would have more than 1 type: [type1, doc]"  
> },  
> "status": 400  
> },

Can [Reindex API](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html) be used to change \_type? painless script or logstash?  
maybe someone can provide examples?

Please advise.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 11, 2017, 4:31am UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-test-as-the-final-mapping-would-have-more-than-1-type-type1-doc/110997/2 "2017-12-11T04:31:35Z")

</div>

Can you show the reindex request you sent?

---

<div class="post-metadata">

**Author:** ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)\
**Post date:** [December 11, 2017, 4:32am UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-test-as-the-final-mapping-would-have-more-than-1-type-type1-doc/110997/3 "2017-12-11T04:32:30Z")

</div>

```
POST _reindex
{
  "source": {
    "index": "myoldindex"
  },
  "dest": {
    "index": "test"
  }
}
```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 11, 2017, 4:39am UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-test-as-the-final-mapping-would-have-more-than-1-type-type1-doc/110997/4 "2017-12-11T04:39:51Z")

</div>

How many types are in the old index?

---

<div class="post-metadata">

**Author:** ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)\
**Post date:** [December 11, 2017, 4:40am UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-test-as-the-final-mapping-would-have-more-than-1-type-type1-doc/110997/5 "2017-12-11T04:40:21Z")

</div>

some have up to 3, but usually just 1.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 11, 2017, 4:41am UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-test-as-the-final-mapping-would-have-more-than-1-type-type1-doc/110997/6 "2017-12-11T04:41:12Z")

</div>

Then you would probably be better off splitting those up into different indices.

---

<div class="post-metadata">

**Author:** ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)\
**Post date:** [December 11, 2017, 4:42am UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-test-as-the-final-mapping-would-have-more-than-1-type-type1-doc/110997/7 "2017-12-11T04:42:27Z")

</div>

that's what i'm trying to do with \_reindex, I can't figure out how to do it with painless script..

---

<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:** [December 11, 2017, 5:21am UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-test-as-the-final-mapping-would-have-more-than-1-type-type1-doc/110997/8 "2017-12-11T05:21:44Z")

</div>

```
POST _reindex
{
  "source": {
    "index": "myoldindex",
    “type”: “type1”
  },
  "dest": {
    "index": "test",
    “type”: “doc”
  }
}
```

---

<div class="post-metadata">

**Author:** ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)\
**Post date:** [December 11, 2017, 8:30pm UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-test-as-the-final-mapping-would-have-more-than-1-type-type1-doc/110997/9 "2017-12-11T20:30:07Z")

</div>

This is exactly what I was looking for) Thank you so much! @dadoonet

---

<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:** [January 8, 2018, 8:30pm UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-test-as-the-final-mapping-would-have-more-than-1-type-type1-doc/110997/10 "2018-01-08T20:30:22Z")

</div>

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