I think there are quite a few use cases that could be addressed via support of child / sibling selectors, such as the > combinator available in CSS.
My use cases include:
How hard would this be?
A bit hard and could potentially be taxing on search performance if you have lots of items.
I see it’s useful though, since other feature requests have been posted about this. Not exact duplicates, but pointing to the same direction: