How to move away from default document type mapping "doc"

The removal of multiple mapping types is a long and drawn out process that will take all the way until version 9 to complete. It is happening in so many steps to avoid any one step causing too much heartache during the upgrade. To clarify, mappings are not being removed: it's vital that each index has a mapping. Support for multiple mapping types within a single index (in new indices) was removed in 6.x, and most of the remaining steps in the process are to do with removing the now-unnecessary type name in all the APIs etc. in which it appears.

In 6.4.2 the main thing to do is to prefer to use _doc as the type name instead of doc; in 7.0 _doc will effectively be the only permitted type name, and it will start to become optional.

The precise details of the changes in 7.0 are still being discussed, but one of the goals is to avoid doing anything that requires applications to be changed simultaneously with the Elasticsearch upgrade. The changes needed will be communicated using things like the deprecation log to catch any places that applications are using Elasticsearch 6.x in ways that won't work in 7.x.

1 Like