Nested type in Elasticsearch: "object mapping can't be changed from nested to non-nested" when indexing a document Nested type in Elasticsearch: "object mapping can't be changed from nested to non-nested" when indexing a document elasticsearch elasticsearch

Nested type in Elasticsearch: "object mapping can't be changed from nested to non-nested" when indexing a document


It seems you're really creating a document of type some_type and comments will default to a normal object (i.e. not nested), which is not allowed since you already have a nested object called comments in the blogpost mapping type in the same index.

Try this instead and it should work:

PUT /my_index/blogpost/1{  "title": "some_title",  "comments": {    "name": "some_name",    "comment": "some_comment"  }}