+++
title = "Upgrading to Elasticsearch Version 7"
weight = 22
updated = 2023-06-17
aliases = ["/docs/upgrading-to-es-7", "/docs/managed-search/elasticsearch-and-opensearch/cluster-management/version-upgrades/guides/upgrading-to-elasticsearch-version-7/"]

[extra]
nav_title = "Upgrading to ES Version 7"
weight = 10
+++

{% admonition(type="info", title="Important") %}
This document serves to highlight key breaking changes for our customers. It
does not represent the
full [list of breaking changes](https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes-7.0.html).
As always, we recommend
you [test your searches on the new version](@/docs/cluster-management/version-upgrades/upgrading-major-versions/index.md)
of Elasticsearch before moving
forward.
{% end %}

Elasticsearch 7 has a stand out breaking change which is the removal of [mapping
types](https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html).
Before this version all versions of Elasticsearch supported the concept
of mapping types, which would let you store different "types" of data in one
index. Elastic is removing this feature after announcing its deprecation in ES 6.

## General Solutions

* Rename all remaining mapping types to `_doc` to align with the future default
* Use 1 index per document type.

This has been the standard recommendation for the best performance in
Elasticsearch since its inception. Rather than index multiple types of
documents into a single index, simply use one index per document type. Many
tools and frameworks supporting Elasticsearch will do this for you
automatically.

## Custom Type Field

For those times when it simply doesn't make sense to have one document type per
index, you can add a dedicated field to the document that declares a document's
given type. Then when you query on that index you will simply pass in which type
you want the query limited to as well.

## From 6.x

After working through the General Solutions above, we recommend you do the
following:

* When creating indices in v6 start setting `include_type_name=false` to get ready
  for the ES7 behavior

## From 5.x

After working through the General Solutions above, we recommend you do the
following:

* Upgrade to at least v5.6 and then turn on `index.mapping.single_type: true`
  to verify you haven't missed anything.

## From 2.x

There are no specific tricks for this upgrade process, outside of the General
Solution listed above. We would simply recommend you follow our [traditional
process](@/docs/cluster-management/version-upgrades/upgrading-major-versions/index.md) for testing your
searches on a new version of Elasticsearch.

## From 1.x

There are no specific tricks for this upgrade process, outside of the General
Solution listed above. We would simply recommend you follow our [traditional
process](@/docs/cluster-management/version-upgrades/upgrading-major-versions/index.md) for testing your
searches on a new version of Elasticsearch.