Rather than trying to come up with all the possible combinations of user actions and the desired outcomes, perhaps try to think of what would be the most frequently used or the simplest scenario first. I say this because if you can come up with a nice and simple rule to start with, it allows you to add complexity to it incrementally and maintain the logic throughout. This is going to be a lot easier than to come up with some complex rule that works well, only to find that it is almost impossible to modify it in the future.
Without knowing what the objects are, lets assume that the userI think it is going into the search only wantinghard to knowwork out what the leave objects are because that's ultimately what they want to interact with, since the internal nodes are only containers of more internal nodes or leaves and are not real objects themselves (at least based on your description). In this case you don't actually need to return the results in a tree structure,optimal behaviour is without having a table will suffice because the leaves can simply be annotated withgood feel for the parent internal node information to provide enough context to allowoverall structure of the user to make a selectiondata. However, if you haveIs it a deeply nested structures and potential fortree or is it broad with shallow links? Are there many leaves to havewith similar matching results, then you can provide a way for a user to navigate up or show more info if required.
When you addproperties or remove search filters, the table will update itself to guide the user on whetherare they need to refineall unique values? Does the search further. The table will have its usual filterinitial tree contain a lot of values and sort features to makeis it easierexpected to navigateincrease in size by a large list of results.lot more?
But lets say that it is more importantWithout being able to know wheretake these things into consideration, I think a simple and consistent set of rules to define the leaves lie inbehaviour will work best. Maybe instead of expanding and collapsing the structuretable as part of the tree itselfsearch and filter result behaviour, then you should start with a tree structure because it will be the best way to representactually return the number of results. I don't know what this use case would be somewhere, but perhapswhether it is not as important to interact withat the leaves as it is to get an overview of where and how manynodes of the search results are located. In this case, you still don't need to show the full expanded tree to start with, but maybe in each node where a valid result lies, provide an aggregate total and use thisthere are matching results or as a guide to helptotal (or grouped by filters). This is important because it helps the userusers narrow down or refine their focussearch strategy without having to go through the tree extensively.
WhenIf you add or modify the search filters, the tree structure search result will simply update itself inleave the tree nodes expanded or collapsed viewas the user chooses, and give them an option to makeexpand or collapse all nodes, it easier forshould simplify the user to see whether they need to refinebehaviour by keeping the tree navigation actions separate from the search result furtheractions.
This is the simplest two solutions I can think of, but the best way is to sketch out some ideas and use some actual dataIt's hard to see ifknow without actually seeing the ideas you come up with make senseinterface or notthe underlying data, so this is my best guess at a possible starting point.