# Removal of types in es 6

**URL:** <https://discuss.elastic.co/t/removal-of-types-in-es-6/133934>\
**Category:** Elasticsearch\
**Created:** [May 30, 2018, 7:27pm UTC](https://discuss.elastic.co/t/removal-of-types-in-es-6/133934 "2018-05-30T19:27:57Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ninad\_Pradhan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ninad_pradhan/32/33548_2.png) [@Ninad\_Pradhan](https://discuss.elastic.co/u/Ninad_Pradhan)\
**Post date:** [May 30, 2018, 7:27pm UTC](https://discuss.elastic.co/t/removal-of-types-in-es-6/133934/1 "2018-05-30T19:27:57Z")

</div>

Am I the only one feeling that es keeps making these fundamental level changes affecting everyone?

If they thought the analogy of tables and databases was a bad one, why did it take them like a thousand releases to know this. Architecturally speaking this is so poor not to have thought of this earlier.

When was the last time in an established db like oracle or any such database, or any such system did we have to remodel our data like this? Granted these are very different, but just for arguments sake Im giving this example.

This is absolutely ridiculous!!

---

<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:** [May 30, 2018, 10:16pm UTC](https://discuss.elastic.co/t/removal-of-types-in-es-6/133934/2 "2018-05-30T22:16:14Z")

</div>

Do you have suggestions for how we can approach these types of changes?

---

<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:** [June 1, 2018, 7:58am UTC](https://discuss.elastic.co/t/removal-of-types-in-es-6/133934/3 "2018-06-01T07:58:55Z")

</div>

> If they thought the analogy of tables and databases was a bad one, why did it take them like a thousand releases to know this.

Because you learn from your community and customers. And this could take time to make a decision.

> Architecturally speaking this is so poor not to have thought of this earlier.

What would have been the consequence of thinking of that one or two years before? Same "pain" for existing users I'm afraid.  
But as far as I recall we have been advertising that a lot the last years that using multiple types should be avoided. At least at conferences, at our trainings and on this forum.

> When was the last time in an established db like oracle...

Oracle has been there for 40 years I think. And indeed this is pretty much stable now.

Note that you can still use the same "type" model you were using before the change. As explained in this blog post: [Removal of mapping types in Elasticsearch 6.0 | Elastic Blog](https://www.elastic.co/blog/removal-of-mapping-types-elasticsearch)

For example, if you had:

```auto
POST index/type1
{
  "foo": "bar",
  "type1": {
    "a": "text"
  }
}
POST index/type2
{
  "foo": "bar",
  "type2": {
    "a": 1234
  }
}

```

You can now index it as:

```auto
POST index/_doc
{
  "type": "type1",
  "foo": "bar",
  "type1": {
    "a": "text"
  }
}
POST index/_doc
{
  "type": "type2",
  "foo": "bar",
  "type2": {
    "a": 1234
  }
}

```

And you will have a similar behavior as what you had. But now you can understand exactly the consequences of having multiple types per index.

> This is absolutely ridiculous!!

Even though I understand your frustration, I don't think it's ridiculous. It has been a hard decision to take to be honest but sometimes you must take decisions instead of letting users shooting a bullet in foot. I'm sorry you have to suffer from it and we will be happy to help you on this forum to move forward.

---

<div class="post-metadata">

**Author:** ![yeikel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yeikel/32/125434_2.png) [@yeikel](https://discuss.elastic.co/u/yeikel)\
**Post date:** [June 3, 2018, 4:57am UTC](https://discuss.elastic.co/t/removal-of-types-in-es-6/133934/4 "2018-06-03T04:57:24Z")

</div>

> Do you have suggestions for how we can approach these types of changes?

I am not sure if the idea of "deprecation warnings" exists in ES, but in technologies such as Java, some type of warning is issued in a lower version when the plan is to remove a feature in a future version.

I think that having a warning about that in ES 5.0 at index time could have prevented people from continuing using it. The same could be done with other features.

The only time we discovered this change is when we went to the release notes of 6.0 when we starting planning to upgrade from 5.0. We built our search API around 5.0 and the idea of using multiple types and now we need to go through a major refactoring phase of our code if we wish to upgrade.

---

<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:** [June 3, 2018, 7:33am UTC](https://discuss.elastic.co/t/removal-of-types-in-es-6/133934/5 "2018-06-03T07:33:32Z")

</div>

Did you try with elasticsearch 5.6 latest?  
I think that warnings should be [there](https://www.elastic.co/guide/en/elasticsearch/reference/current/logging.html#deprecation-logging).

---

<div class="post-metadata">

**Author:** ![yeikel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yeikel/32/125434_2.png) [@yeikel](https://discuss.elastic.co/u/yeikel)\
**Post date:** [June 3, 2018, 7:53am UTC](https://discuss.elastic.co/t/removal-of-types-in-es-6/133934/6 "2018-06-03T07:53:59Z")

</div>

I did not know this existed. Thank you

---

<div class="post-metadata">

**Author:** ![Johnnycc1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johnnycc1/32/26069_2.png) [@Johnnycc1](https://discuss.elastic.co/u/Johnnycc1)\
**Post date:** [June 3, 2018, 8:31am UTC](https://discuss.elastic.co/t/removal-of-types-in-es-6/133934/7 "2018-06-03T08:31:13Z")

</div>

I'm not sure if its of any help to others during their transition to single type indexes.

But it is still possible to create an alias across multiple indexes. So if you split your data by type into multiple indexes you can then alias the indexes together to search like it was one index.

---

<div class="post-metadata">

**Author:** ![Ninad\_Pradhan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ninad_pradhan/32/33548_2.png) [@Ninad\_Pradhan](https://discuss.elastic.co/u/Ninad_Pradhan)\
**Post date:** [June 4, 2018, 9:58pm UTC](https://discuss.elastic.co/t/removal-of-types-in-es-6/133934/8 "2018-06-04T21:58:18Z")

</div>

Thanks for getting back. I just gave this as an example, also I certainly disagree that it would elasticsearch the community and customers experience for the something as fundamental as types, I just feel its overwhelming for a startup like ours to keep making such huge changes every year just for one component like elasticsearch, we rather have something that doesn't make us change our code so often and focus on our business problems. Yes oracle is very exaggerated example I gave just to drive the point. Also es has been around for about 8 years now, thats not very like just a year or something. I hope elasticsearch takes into account these frustrations and improves on it, so on every release customers dont have to make code changes.

---

<div class="post-metadata">

**Author:** ![Ninad\_Pradhan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ninad_pradhan/32/33548_2.png) [@Ninad\_Pradhan](https://discuss.elastic.co/u/Ninad_Pradhan)\
**Post date:** [June 5, 2018, 6:12pm UTC](https://discuss.elastic.co/t/removal-of-types-in-es-6/133934/9 "2018-06-05T18:12:24Z")

</div>

Also not to mention, the support of type is being deprecated in es 7 and not supported in 8, so I don't know if its a good idea to use it now and change everything again. Better to bite the bullet and remove it now.

---

<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:** [June 5, 2018, 10:19pm UTC](https://discuss.elastic.co/t/removal-of-types-in-es-6/133934/10 "2018-06-05T22:19:13Z")

</div>

Probably because you don't imagine all the implications. But API wise that's the only to make that happen without making more mess.

BTW deprecation starts from 5.6 IIRC.  
6.x can read 5.6 with multiple types but you can't create new index with multiple types in 6.x.  
7.x will add support for ignoring the type parameter IIRC.  
8.x will remove definitely the type parameter from all APIs.

---

<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 3, 2018, 10:19pm UTC](https://discuss.elastic.co/t/removal-of-types-in-es-6/133934/11 "2018-07-03T22:19:13Z")

</div>

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