Elasticsearch 7.0.0, released on April 10, 2019, changes the default format for creating an index and defining its fields. Requests no longer expect a mapping type name wrapped around those field definitions. For teams moving from version 6.7, scripts that create indices or install templates need changes too: either change their JSON bodies to the new format or explicitly request the older one during the transition. Changing the request URL alone does not address that body format. [S1][S3]

A mapping type was a way to label a kind of document within an index, not an independent SQL table. Elastic's documentation explains that fields with the same name in different types shared the same underlying Lucene field and had to use the same definition. Indices created in Elasticsearch 6.x already allowed only one mapping type. The 7.0 compatibility option therefore concerns how requests express that mapping; it does not restore multiple types in a new index. [S3]

The switch is include_type_name. For index-creation, index-template and mapping APIs, it defaults to true in 6.7 and false in 7.0. In the new index-creation body, properties sits directly under mappings, without an intervening type name. Setting include_type_name=true tells 7.0 to expect the older, named form. That is a transition measure: setting the parameter to either value in 7.0 produces a deprecation warning. In 6.7, by contrast, Elastic advises setting it explicitly to prepare for the upgrade, and either value avoids that particular warning. This retrospective also consults a later-retrieved version 7.0 guide whose publication date is unknown; the release-tag documentation separately supports the technical behavior described here. [S2][S3]

Mixed-version clusters need a separate check. Elastic's release documentation says to specify include_type_name on requests such as index creation when 6.7 and 7.0 nodes coexist, because the same mapping definition will not be valid under both nodes' defaults. But this does not make every new API work on an old node. Typeless bulk and update document calls are available only from 7.0 and do not work with 6.7 nodes. Making the mapping format explicit and switching document calls are separate rollout decisions. [S3]

Application responses can change even when the stored index still has its old type name. Typeless index and get calls work against an index with a custom type. Yet a typeless response reports the dummy value _doc in its _type field, rather than that custom name; the deprecated typed API returns the mapping type as before. A consumer that uses the response's _type to classify documents therefore needs a behavior check, not merely confirmation that the field is still present. [S3]

Templates need testing with the requests that use them. Elastic recommends re-adding templates with include_type_name=false. When a template and an explicit index-creation request use different typed or typeless forms, the request decides whether the new index has a type, while the template still contributes its fields. Automatic creation triggered by a write to a nonexistent index follows the template instead. Teams should test the creation path their application actually uses: a corrected template can still be paired with a request that creates a typed index. [S3]

Source documents

  1. Elasticsearch 7.0.0 released — Shane Connellyhttps://www.elastic.co/blog/elasticsearch-7-0-0-released
  2. Removal of mapping types — Elasticsearch Guide [7.0]https://www.elastic.co/guide/en/elasticsearch/reference/7.0/removal-of-types.html
  3. Removal of mapping types — Elasticsearch v7.0.0 release-tag documentationhttps://raw.githubusercontent.com/elastic/elasticsearch/b7e28a7232616c7a21bc879a535d801b8553ba77/docs/reference/mapping/removal_of_types.asciidoc