Elasticsearch 6.0 Removal of mapping types

Federico Panini
14 min readSep 26, 2017

series : Elasticsearch 6.0 is coming

Disclaimer : Elasticsearch 6.0 is not yet released so please use it carefully for sure NOT in a production environment. This article is intended for testing and understanding the new improvements from ES 6.0. 

What are Elasticsearch Types ?

A Type in Elasticsearch is so defined : “A type in Elasticsearch represent a class of similar documents”. It’s a logical aggregation we can use to identify clusters of similar documents. There was an official document which used to compare relational Databases to Elasticsearch Indices:

  1. Indices are similar to Databases/Schemas
  2. Types are compared in the DB Relational “world” to as Tables

Types are more than this and a bit more complex, and that’s why we will discover at the end of this article that in the next Major release of Elasticsearch (6.0 !!!) types will be removed… oh yes… that is the rude reality :) And so you can ask me “Why are you explaining us what are types if they will be removed soon ?”.

This is a real good question, but you have to know and to understand that for the majority of Elasticsearch users, TYPES are heavily used (and sometimes misused…) so I would like to remind to all of us, what are types, how they are used and then finally discovering why they’ve been removed and how to work with Elasticsearch without TYPES.

Every Index can have multiple Types for example “user” and “blogpost”, and every Type could have its own field. A field define the name of the field itself and the type that could be for example text, numeric (integer, long, short…), keyword, array and many many others. The complete list of fields type is :

  • array
  • binary
  • range
  • boolean
  • date