Possible to create duplicate child ids in parent/child?


I'm trying to create parent documents with multiple children.
For example one parent has the id "1" and has a child with the id "child_1".
And then there is another parent document with the id "2" and has also a child with the id "child_1", but both children are different documents of the same type.

While I was testing this (simple elasticsearch service on a windows machine, single node, v2.3.0), I discovered something strange. When I created a test index with 5 shards and 1 replica, creating the documents is working fine. But when I change the number of shards to 1, 2 or 4, it fails with the error message, telling me the document "child_1" already exists. I've tried any number from 1 to 17.. and luckily the wanted value is 4 :slight_smile:

Now I don't know if this is expected behaviour or a bug?
Should I give every child a unique id like "child1_1" and "child1_2" to avoid this? It would be easier for me to use the same ids on the children, because I need to provide the parent's id in a request anyway..

Examples can be provided if needed for further investigation.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.