I'm trying to get some more information about Parent Child (_parent) mapping functionality in elasticsearch, I have not been able to find a definitive answer to these questions:
Can parent child mappings be nested to more than two levels?
Can a document have multiple parents of different types?
Can a document have multiple children of different types?
It seems like the answer to all these questions is probably "yes" but I don't want to guess, and was hoping to avoid conducting experiments.
Hi Mark, thanks for your reply. I wanted to be sure I have this right. So, in a relational schema, a table can have multiple foreign keys, which correspond to multiple parents. So ES doesn't support this concept of multiple "FKs" in a document, it would only allow a single "FK"/_parent designation?
I don't understand why a parent/child would be used when nested works. I see _parent as an approach to use when the parent must be maintained as a separate document, probably because of its other relationships outside any single document to which it is being declared as _parent
An example would be an ES implementation of a relational dimensional star design, where each dimension is a parent to a fact, but dimensions can be associated with more than one fact (table)- each dimension would have multiple children, and each fact would have multiple parents.
Situation where u have updates coming, like children getting added. In case parent-child, a child could be easily added independent of parent getting updated while in nested the document will be updated (delete/add) - OR does ES intelligently adds a new nested (child) document w/o touching parent?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.