# Reindex changing types

**URL:** <https://discuss.elastic.co/t/reindex-changing-types/102808>\
**Category:** Elasticsearch\
**Created:** [October 5, 2017, 8:07am UTC](https://discuss.elastic.co/t/reindex-changing-types/102808 "2017-10-05T08:07:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alejandro\_Arrojo](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@Alejandro\_Arrojo](https://discuss.elastic.co/u/Alejandro_Arrojo)\
**Post date:** [October 5, 2017, 8:07am UTC](https://discuss.elastic.co/t/reindex-changing-types/102808/1 "2017-10-05T08:07:40Z")

</div>

Hello!

It's possible to reindex, changing datatype of a field? Or it's not possible and I have to delete bad fields and reindex without them?

Thanks so much.

---

<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:** [October 5, 2017, 8:08am UTC](https://discuss.elastic.co/t/reindex-changing-types/102808/2 "2017-10-05T08:08:33Z")

</div>

You can use ingest node feature while reindexing but what is exactly the problem you have?

---

<div class="post-metadata">

**Author:** ![Alejandro\_Arrojo](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@Alejandro\_Arrojo](https://discuss.elastic.co/u/Alejandro_Arrojo)\
**Post date:** [October 5, 2017, 8:22am UTC](https://discuss.elastic.co/t/reindex-changing-types/102808/3 "2017-10-05T08:22:31Z")

</div>

it's simple. I have an index like this:

```auto
"field": {
    "properties": {
        "subfield1": {
            "type": "float"
        },
        "subfield2": {
            "type": "float"
        },
        "subfield3": {
            "type": "text"
        }
    }
}

```

and I want to change a subfield. More or less like that:

```auto
"field": {
    "properties": {
        "subfield1": {
            "type": "float"
        },
        "subfield2": {
            "type": "float"
        },
        "subfield3": {
            "type": "float"
        }
    }
}

```

Right now I have some data with the original mapping, but it doesn't matter if some subfield3 data must be deleted.

Any idea?

---

<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:** [October 5, 2017, 8:48am UTC](https://discuss.elastic.co/t/reindex-changing-types/102808/4 "2017-10-05T08:48:20Z")

</div>

Please format your code using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

I edited your post.

1. Define an ingest pipeline which uses [https://www.elastic.co/guide/en/elasticsearch/reference/master/convert-processor.html](https://www.elastic.co/guide/en/elasticsearch/reference/master/convert-processor.html)
2. Use this ingest pipeline in the reindex operation.

---

<div class="post-metadata">

**Author:** ![Alejandro\_Arrojo](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@Alejandro\_Arrojo](https://discuss.elastic.co/u/Alejandro_Arrojo)\
**Post date:** [October 5, 2017, 8:56am UTC](https://discuss.elastic.co/t/reindex-changing-types/102808/5 "2017-10-05T08:56:42Z")

</div>

Thanks so much. You're right, much more readable.

I'm going to try your solution.

---

<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:** [November 2, 2017, 8:56am UTC](https://discuss.elastic.co/t/reindex-changing-types/102808/6 "2017-11-02T08:56:49Z")

</div>

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