Mapping types are going away. Elasticsearch 6.0 supports a single mapping
type per index only, and it represents the first step on the way to removing
types altogether.
This blog post explains what types are, why we are removing them, how you can
migrate your indices to a single type world, and lays out the full schedule
for type removal over the next three major versions.
- What are mapping types?
- Why are mapping types being removed?
- Alternatives to mapping types
- Custom type field
- Index per document type
- Parent/Child without mapping types
- Schedule for removal of mapping types
- Migrating multi-type indices to single-type
- Custom type field
- Index per document type
<tldr>
- Indices created in Elasticsearch 6.0.0 or later may contain a
single mapping type only. - Indices created in 5.x with multiple
mapping types will continue to function as before in Elasticsearch 6.x. - Mapping types will be completely removed in Elasticsearch 7.0.0
although some backwards compatibility features will only be removed in 9.0.0.
</tldr>
parent-child relationship between documents, so documents of type question
could be parents to
documents of type answer
.
join field.
join field replacement for parent-child is available on indices created in 5.6.
join field replacement for parent-child is available on indices created in 5.6.
Elasticsearch 6.x
- Indices created in 5.x will continue to function in 6.x as they did in 5.x.
- Indices created in 6.x only allow a single-type per index. Any name can be used for the type, but there can be only one.
- The
_type
name can no longer be combined with the_id
to form the_uid
field. The_uid
field has become an alias for the_id
field. - New indices no longer support the old-style of parent/child and should use the join field instead.
- The
_default_
mapping type is deprecated.
Elasticsearch 7.x
- The
type
parameter in URLs are optional. For instance, indexing a document no longer requires a documenttype
. - The
GET|PUT _mapping
APIs support a query string parameter (include_type_name
) which indicates whether the body should include a layer for the type name. It defaults totrue
. 7.x indices which don’t have an explicit type will use the dummy type name_doc
. - The
_default_
mapping type is removed.
Elasticsearch 8.x
- The
type
parameter is no longer supported in URLs. - The
include_type_name
parameter defaults tofalse
.
Elasticsearch 9.x
- The
include_in_type
parameter is removed.