Can’t merge a non object mapping with an object mapping error in machine learning(beta) module Can’t merge a non object mapping with an object mapping error in machine learning(beta) module elasticsearch elasticsearch

Can’t merge a non object mapping with an object mapping error in machine learning(beta) module


The error message means that you are trying to change an existing mapping. However, that is not possible in Elasticsearch. Once a mapping has been created, it cannot be changed.

As explained by Shay Banon himself:

You can't change existing mapping type, you need to create a new index with the correct mapping and index the data again.

So you must create a new index to create this mapping. Depending on the situation, you either

  • create an additional index, or
  • delete the current index and re-create it from scratch.

Of course in the latter case you will lose all data in the index, so prepare accordingly.