We have also experienced this issue where we are now using parent/child
documents. We are using 0.90.5 version.
Our application requires that we re-assign a child to a new parent from
time to time and we discovered that without first deleting the child with
the old parent, two documents with the same _id but different parents can
be in the index because the parents are on different shards. Does anyone
know if it is possible to reassign a child to a new parent without first
deleting might something available in newer versions? It seems reasonable
that a document can be updated by it's canonical document id (_id), without
having to aware of the subtleties of sharding?
On Thursday, June 14, 2012 11:39:56 AM UTC-4, Florian Gilcher wrote:
>
> Hi,
>
> I have been playing around with parent/child documents lately and the
> following question came up: is it possible to change the parent of a
> document?
>
> Say, I have the following two documents:
>
> /person/1 -d {}
> /person/2 -d {}
>
> and an asset:
>
> /asset/3?parent=1
>
> is it possible to change the parent to "2"?
>
> Reindexing with parent 2 only seems to introduce a second document. (which
> makes sense, as parent doubles as routing parameter)
>
> I tried setting the _parent field directly to 2 in multiple ways (index,
> update with script), but it somehow seemed to render elasticsearch
> inconsistent (e.g. parents were still querying their old childs on
> has_child).
>
> Is this possible or supported? Or do I have to delete the old document and
> index a new one with the same source, but different _parent settings?
>
> Best Regards,
> Florian
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/7546af8c-cf8c-4960-97b1-876fdf264702%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.