How to disassociate parent-child relationship through re-indexing

  • I have a index with parent-child relationship. A type is the parent of C type. I want to reindex C type documents into its own index. I'm doing this through reindex API. When I run the command, I get following error:

{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Can't specify parent if no parent field has been configured"
}
],
"type": "illegal_argument_exception",
"reason": "Can't specify parent if no parent field has been configured"
},
"status": 400
}

  • I want to get rid of parent references in Child type.

Reindex supports removing the parent but you'd need to do with a script like ctx._parent=null.

1 Like