I\'m trying to convert a project to use the latest Elasticsearch 6 and am having this problem. I don\'t know if the problem is \"Product\" vs \"product\". In my mappings and att
I deleted the index and recreated it and it appears to be fine now. I think when I first created the index I didn't have the correct attribute name so that might explain the error I was getting.
Prior to elasticsearch v6, an index can have only 1 mapping by default. In previous version 5.x, multiple mapping was possible for an index. Though you may change this default setting by updating index setting "index.mapping.single_type": false
.
In your case, my assumption is you had already created the index with mapping Product
. That is why it was rejecting new mapping in your second request with "product" (p in small case).
In my case I was trying to delete a record following the official docs and I blindly put the _doc
in the URL which led to this error.
This should be the mapping that you see under the Indices
tab against Mappings
section in the AWS console. changing the value in the URL solved it for me.
Hope this was helpful :)
As Batsu says, from version 5 of elasticSearch onwards, the concept of treating the index as the database and the type as a table was removed to implement a lucene optimization.
The solution is to use an index by @Document.
Referral: https://www.elastic.co/guide/en/elasticsearch/reference/6.7/removal-of-types.html
This is because of a breaking change in ES 6.x: mapping types were removed (even if for backward compatibility you can still specify it in the path) thus de facto limiting the index to a single type.
See here for more info.