# How can I change the type with the reindex api

**URL:** <https://discuss.elastic.co/t/how-can-i-change-the-type-with-the-reindex-api/121639>\
**Category:** Elasticsearch\
**Created:** [February 27, 2018, 11:19am UTC](https://discuss.elastic.co/t/how-can-i-change-the-type-with-the-reindex-api/121639 "2018-02-27T11:19:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![T3rm11](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@T3rm11](https://discuss.elastic.co/u/T3rm11)\
**Post date:** [February 27, 2018, 11:19am UTC](https://discuss.elastic.co/t/how-can-i-change-the-type-with-the-reindex-api/121639/1 "2018-02-27T11:19:22Z")

</div>

I need to reindex some indices because of the update to version 6. The new index needs to be of the type "doc" because Logstash is writing to it. How can I do this when the type is different in the source index?

I normal call to reindex creates the same type in the destination index. This doesn't work.

---

<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:** [February 27, 2018, 1:51pm UTC](https://discuss.elastic.co/t/how-can-i-change-the-type-with-the-reindex-api/121639/2 "2018-02-27T13:51:40Z")

</div>

What did you try? This?

```
POST _reindex
{
  "source": {
    "index": "twitter"
  },
  "dest": {
    "index": "new_twitter",
   "type": "doc"
  }
}
```

---

<div class="post-metadata">

**Author:** ![T3rm11](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@T3rm11](https://discuss.elastic.co/u/T3rm11)\
**Post date:** [February 27, 2018, 2:26pm UTC](https://discuss.elastic.co/t/how-can-i-change-the-type-with-the-reindex-api/121639/3 "2018-02-27T14:26:59Z")

</div>

I did it without the type in destination. Couldn't find any documentation on this. The reindex documentation is rather bad. There is no overview about what is allowed in source and destination

Anway, I will give it a try. Thanks.

---

<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:** [February 27, 2018, 2:38pm UTC](https://discuss.elastic.co/t/how-can-i-change-the-type-with-the-reindex-api/121639/4 "2018-02-27T14:38:59Z")

</div>

> The reindex documentation is rather bad.

It can happen indeed. That's why we love when our users send documentation PR 🙂

---

<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:** [March 27, 2018, 2:39pm UTC](https://discuss.elastic.co/t/how-can-i-change-the-type-with-the-reindex-api/121639/5 "2018-03-27T14:39:07Z")

</div>

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