# Elasticsearch 6.2.4 Preparing for removal of mapping types

**URL:** <https://discuss.elastic.co/t/elasticsearch-6-2-4-preparing-for-removal-of-mapping-types/134064>\
**Category:** Elasticsearch\
**Created:** [May 31, 2018, 1:43pm UTC](https://discuss.elastic.co/t/elasticsearch-6-2-4-preparing-for-removal-of-mapping-types/134064 "2018-05-31T13:43:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ld\_pvl](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@ld\_pvl](https://discuss.elastic.co/u/ld_pvl)\
**Post date:** [May 31, 2018, 1:43pm UTC](https://discuss.elastic.co/t/elasticsearch-6-2-4-preparing-for-removal-of-mapping-types/134064/1 "2018-05-31T13:43:46Z")

</div>

Hi Team,

Could you please help to clear a confusion I have with regards to the future removal of mapping types?

According to [the documenation](https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html#_schedule_for_removal_of_mapping_types):

- the `_default_` mapping type is deprecated and will be removed in 7.x
- the preferred type name is `_doc`

Given the above, I am in the process of changing the templates. However, I noticed that when Logstash sends data to Elasticsearch, the type is `doc` and not `_doc` by default (I did not set any specific type in logstash.conf).

I verified that the type in my index is of type `doc` because `GET {index}/_doc/{id}` does not work and this `GET {index}/doc/{id}` works.

So I assuming, in my templates I should define the mapping for `doc` type and not `_doc` even though in the above documentation the recommended type is `_doc`?

Cheers,

---

<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:** [May 31, 2018, 1:56pm UTC](https://discuss.elastic.co/t/elasticsearch-6-2-4-preparing-for-removal-of-mapping-types/134064/2 "2018-05-31T13:56:48Z")

</div>

I think that the rest of the stack is going to be updated to use \_doc indeed. I did not check if it has been done or not yet and is ready for 6.3.

---

<div class="post-metadata">

**Author:** ![ld\_pvl](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@ld\_pvl](https://discuss.elastic.co/u/ld_pvl)\
**Post date:** [May 31, 2018, 2:09pm UTC](https://discuss.elastic.co/t/elasticsearch-6-2-4-preparing-for-removal-of-mapping-types/134064/3 "2018-05-31T14:09:14Z")

</div>

If suddenly the stack switches from `doc` to `_doc`, I think it might cause some problems, because:

- I used to use `_default_` in templates which basically applies the mappings regardless of type.
- Now, I am switching to `doc` because that is what stuff from Logstash is mapped to.
- In the future, Logstash switches to `_doc` cos the stack switched to `_doc` and suddenly my mappings which are defined only for `doc` type stop being applied 😓.

Is what I'm thinking above possible?

If it is possible, does that mean to prevent the above problem from happening, I should define two exactly the same set of mappings one for `_doc` and one for `doc` - basically in anticipation of the stack switch from `doc` to `_doc`?

---

<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:** [May 31, 2018, 2:22pm UTC](https://discuss.elastic.co/t/elasticsearch-6-2-4-preparing-for-removal-of-mapping-types/134064/4 "2018-05-31T14:22:40Z")

</div>

I think you can anticipate what will happen with:

> <https://github.com/elastic/logstash/issues/9326>

My 0.05 cents.

---

<div class="post-metadata">

**Author:** ![ld\_pvl](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@ld\_pvl](https://discuss.elastic.co/u/ld_pvl)\
**Post date:** [May 31, 2018, 2:43pm UTC](https://discuss.elastic.co/t/elasticsearch-6-2-4-preparing-for-removal-of-mapping-types/134064/5 "2018-05-31T14:43:53Z")

</div>

Thanks for the link.

So if I understood the github issue correctly then `_doc` will be used going forward for Logstash.

So unless I change my logstash.conf to explicitly set documents sent by Logstash to retain the old type `doc`, it will be changed to `_doc`. Therefore, I will now have old indexes with type `doc` and new indexes with type `_doc` which might or might not cause some subsequent problems.

When 7.x it's gonna be adventurous 😄.

---

<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:** [May 31, 2018, 3:19pm UTC](https://discuss.elastic.co/t/elasticsearch-6-2-4-preparing-for-removal-of-mapping-types/134064/6 "2018-05-31T15:19:46Z")

</div>

Should not be an issue hopefully. Worse case you can always use the reindex API to rename old doc type to \_doc type?

---

<div class="post-metadata">

**Author:** ![ld\_pvl](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@ld\_pvl](https://discuss.elastic.co/u/ld_pvl)\
**Post date:** [May 31, 2018, 3:26pm UTC](https://discuss.elastic.co/t/elasticsearch-6-2-4-preparing-for-removal-of-mapping-types/134064/7 "2018-05-31T15:26:16Z")

</div>

Agreed, in the worst case, I would have to reindex. Thanks again!

---

<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:** [June 28, 2018, 3:26pm UTC](https://discuss.elastic.co/t/elasticsearch-6-2-4-preparing-for-removal-of-mapping-types/134064/8 "2018-06-28T15:26:19Z")

</div>

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