# Mapping types \_type or type or both

**URL:** https://discuss.elastic.co/t/mapping-types-type-or-type-or-both/166359
**Category:** Elasticsearch
**Created:** [January 30, 2019, 12:55pm UTC](https://discuss.elastic.co/t/mapping-types-type-or-type-or-both/166359 "2019-01-30T12:55:58Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![gormanst](https://avatars.discourse-cdn.com/v4/letter/g/87869e/32.png) [@gormanst](https://discuss.elastic.co/u/gormanst)
#### Post date: [January 30, 2019, 12:55pm UTC](https://discuss.elastic.co/t/mapping-types-type-or-type-or-both/166359/1 "2019-01-30T12:55:59Z")

</div>

Is type, as used below, being removed from elasticsearch?

```
PUT _template/dogpound_mpds
{
"index_patterns": ["dogpound_mpds*"],
"mappings" : {
    "_doc" : {
        "dynamic": "true",
        "properties": {
          "twitter": {"type": "text","fields": {"keyword": {"type": "keyword","ignore_above": 256}}},
          "cowboy": {"type": "text","fields": {"keyword": {"type": "keyword","ignore_above": 256}}},
          "start": {"type": "date"}
          "duration": {"type": "integer"}
        }
    }
},
"aliases": {
    "dogpound_mpds": {}
}
}
```

---

<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: [January 30, 2019, 12:57pm UTC](https://discuss.elastic.co/t/mapping-types-type-or-type-or-both/166359/2 "2019-01-30T12:57:10Z")

</div>

Your formatting is not the best, can you wrap the code in markdown style backticks?

---

<div class="post-metadata">

### Author: ![gormanst](https://avatars.discourse-cdn.com/v4/letter/g/87869e/32.png) [@gormanst](https://discuss.elastic.co/u/gormanst)
#### Post date: [January 30, 2019, 1:05pm UTC](https://discuss.elastic.co/t/mapping-types-type-or-type-or-both/166359/3 "2019-01-30T13:05:35Z")

</div>

like that?

---

<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: [January 30, 2019, 1:14pm UTC](https://discuss.elastic.co/t/mapping-types-type-or-type-or-both/166359/4 "2019-01-30T13:14:52Z")

</div>

Great, thanks!

The mapping `type` is not going anywhere.  
The `_doc` type above is what is changing.

---

<div class="post-metadata">

### Author: ![gormanst](https://avatars.discourse-cdn.com/v4/letter/g/87869e/32.png) [@gormanst](https://discuss.elastic.co/u/gormanst)
#### Post date: [January 30, 2019, 1:18pm UTC](https://discuss.elastic.co/t/mapping-types-type-or-type-or-both/166359/5 "2019-01-30T13:18:11Z")

</div>

I am trying to prepare for the removal of mapping types.

[https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html)

I thought by using "\_doc" I was headed in the right direction?

Can you explain?

---

<div class="post-metadata">

### Author: ![gormanst](https://avatars.discourse-cdn.com/v4/letter/g/87869e/32.png) [@gormanst](https://discuss.elastic.co/u/gormanst)
#### Post date: [January 30, 2019, 1:51pm UTC](https://discuss.elastic.co/t/mapping-types-type-or-type-or-both/166359/6 "2019-01-30T13:51:54Z")

</div>

don't forget about me?

---

<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: [January 30, 2019, 1:56pm UTC](https://discuss.elastic.co/t/mapping-types-type-or-type-or-both/166359/7 "2019-01-30T13:56:30Z")

</div>

You are.  
By only having one `_type`, that is `_doc`, when we remove `_type`s completely you are already prepared.

> [@gormanst](#):
>
> don't forget about me?

What do you mean?

---

<div class="post-metadata">

### Author: ![gormanst](https://avatars.discourse-cdn.com/v4/letter/g/87869e/32.png) [@gormanst](https://discuss.elastic.co/u/gormanst)
#### Post date: [January 30, 2019, 2:01pm UTC](https://discuss.elastic.co/t/mapping-types-type-or-type-or-both/166359/8 "2019-01-30T14:01:19Z")

</div>

> [@warkolm](#):
>
> The `_doc` type above is what is changing.

I am concerned that now I will have trouble with "\_doc". I think I still have a fundamental misunderstanding about what it means to have mapping types removed. Your initial response seems to indicate I will have problems because something is changing with "\_doc"?

---

<div class="post-metadata">

### Author: ![gormanst](https://avatars.discourse-cdn.com/v4/letter/g/87869e/32.png) [@gormanst](https://discuss.elastic.co/u/gormanst)
#### Post date: [January 30, 2019, 2:26pm UTC](https://discuss.elastic.co/t/mapping-types-type-or-type-or-both/166359/9 "2019-01-30T14:26:31Z")

</div>

still with me?

---

<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: [January 30, 2019, 3:10pm UTC](https://discuss.elastic.co/t/mapping-types-type-or-type-or-both/166359/10 "2019-01-30T15:10:34Z")

</div>

Read [this](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and specifically the "Also be patient" part.

It's fine to answer on your own thread after 2 or 3 days (not including weekends) if you don't have an answer.

---

<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: [January 30, 2019, 3:28pm UTC](https://discuss.elastic.co/t/mapping-types-type-or-type-or-both/166359/11 "2019-01-30T15:28:15Z")

</div>

In that example you gave you have two "types";

1. the `type` referring to the mapping of a **specific** field. This is not changing
2. the `_type` referring to the mapping of a document variant

The second one is changing.

> [@gormanst](#):
>
> still with me?

What do you mean?

---

<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: [February 27, 2019, 3:28pm UTC](https://discuss.elastic.co/t/mapping-types-type-or-type-or-both/166359/12 "2019-02-27T15:28:17Z")

</div>

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