# Removal of mapping types | Elasticsearch Guide \[7.17\] | Elastic

**URL:** <https://discuss.elastic.co/t/removal-of-mapping-types-elasticsearch-guide-7-17-elastic/308657>\
**Category:** Elasticsearch\
**Tags:** painless\
**Created:** [July 1, 2022, 11:50am UTC](https://discuss.elastic.co/t/removal-of-mapping-types-elasticsearch-guide-7-17-elastic/308657 "2022-07-01T11:50:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Max\_Pinto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/max_pinto/32/100500_2.png) [@Max\_Pinto](https://discuss.elastic.co/u/Max_Pinto)\
**Post date:** [July 1, 2022, 11:50am UTC](https://discuss.elastic.co/t/removal-of-mapping-types-elasticsearch-guide-7-17-elastic/308657/1 "2022-07-01T11:50:02Z")

</div>

> **[Removal of mapping types | Elasticsearch Guide \[7.17\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/removal-of-types.html#_custom_type_field_2)**

```auto
POST _reindex
{
  "source": {
    "index": "twitter"
  },
  "dest": {
    "index": "new_twitter"
  },
  "script": {
    "source": """
      ctx._source.type = ctx._type;
      ctx._id = ctx._type + '-' + ctx._id;
      ctx._type = '_doc';
    """
  }
}

```

I want to understand what this "ctx" refers to. There is left hand ctx and there is right hand ctx. I am confused on what's actually going on in the "source" field. Can somebody help me understand the script?

---

<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 29, 2022, 11:50am UTC](https://discuss.elastic.co/t/removal-of-mapping-types-elasticsearch-guide-7-17-elastic/308657/2 "2022-07-29T11:50:33Z")

</div>

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