Can a child document have multiple parents?


(Nick Hoffman) #1

Hey guys. In a parent-child relationship, can a child have multiple
parents? If not, is the only workaround to create multiple copies of the
child, once for each of its parents?

Thanks,
Nick


(Shay Banon) #2

No, it can't, because the parent controls which shard the child document
will end at (it has to be on the same shard as the parent document).

On Tue, Jan 17, 2012 at 7:33 AM, Nick Hoffman nick@deadorange.com wrote:

Hey guys. In a parent-child relationship, can a child have multiple
parents? If not, is the only workaround to create multiple copies of the
child, once for each of its parents?

Thanks,
Nick


(Nick Hoffman) #3

That makes sense, though it makes it difficult to deal with children with
multiple parents. Are there any other solutions besides indexing a copy of
a child for each of its parents?


(Shay Banon) #4

Nothing except for you doing it explicitly.

On Tue, Jan 17, 2012 at 4:45 PM, Nick Hoffman nick@deadorange.com wrote:

That makes sense, though it makes it difficult to deal with children with
multiple parents. Are there any other solutions besides indexing a copy of
a child for each of its parents?


(mihai) #5

As a developer, I can make sure that all the parents and the children
reside in the same shard, and every additional child or parent will be
routed to that shard.

Having this issue out of the way, can I set _parent: [parent1, parent2,
..., parentN]?

On Tuesday, January 17, 2012 9:57:36 AM UTC, kimchy wrote:

No, it can't, because the parent controls which shard the child document
will end at (it has to be on the same shard as the parent document).

On Tue, Jan 17, 2012 at 7:33 AM, Nick Hoffman <ni...@deadorange.com<javascript:>

wrote:

Hey guys. In a parent-child relationship, can a child have multiple
parents? If not, is the only workaround to create multiple copies of the
child, once for each of its parents?

Thanks,
Nick

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/881decec-8593-48ae-9162-90424178e7e9%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(James Cook-2) #6

This is an older thread, but I second @mihal in asking, if the developer can make sure via routing that each document is on the same shard, is there any technical reason why multiple parents cannot be supported?


(system) #7