Mikhail: I don't fully understand what's going on here yet, but i know Yonik is on vaca for a week or so – so i'll go ahead and commit your patch along with an @Ignore on testGrandChildren
we can allow users to be aware about physical layout of docs
I don't think we should expect users to be aware of the layout. if we wnat to have low level "grey box" tests that know about those details then so be it – but the non-test code shouldn't assume end users know anything about the implementation details unless we have no other choice.
we don't want users to rely, and oblige them to nest grand children into children as well as children are nested into parents.
This sounds like the right course of action: if you have child docs, use addChildDocument on your parent doc; if you have grandchildren, use addChildDocument on the appropriate existing child that is the parent of the grand-child you want to add.
Based on the current API of SolrInputDocument, I can't imagine it working any other way.
Please raise a separate issue for testGrandChildren(). it can be temporarily ignored for a while.
I'd prefer to leave this issue (
SOLR-5168) open for now to track the test failures until they are resolved (that's the point of it's existence).
It's not clear to me if you are saying that fixing the "grandchildren" issue requires fixing AddUpdateCommand.flatten() – in which case please open a new issue to specifically address that. (if the fix for the new issue automatically fixes this issue then great). If however the remaining problem is simply bad assumptions in this test, then we can continue to use this issue to track it.