I'm trying to add a new type as a child of an existing type. From ElasticSearch documentation, it looks like this is possible but there is no details about how to do it.
Here's what the documentation says:
This must be done at index creation time, or with the update-mapping API before the child type has been created.
There are no details about setting up a parent-child relationship in the update-mapping API documentation.
Intuitively, I think a parent-child relationship should be allowed to be established after a parent already exists since the parent does not need to know anything about the child.
Here's the error I'm getting when I create a new type as a child:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "can't add a _parent field that points to an already existing type"
}
],
"type": "illegal_argument_exception",
"reason": "can't add a _parent field that points to an already existing type"
},
"status": 400
}