Forum Discussion
Container tree - PnP Modern Search
Hi FabienG, to be direct: the 'Container Tree' option you are seeing is a known limitation—it does not currently support true hierarchical rendering for standard SharePoint managed properties because, as Dave noted, those properties are stored as a flat list in the search index.
Since the community standard hasn't bridged this gap, here is the only reliable way to implement a tree-view filter:
Custom Refiner Template: You must move beyond the 'Standard' filter templates. You need to develop a custom Handlebars template for the PnP Modern Search filter web part.
Logic Injection: Your custom template needs to include JavaScript logic that takes the 'flat' response from the Search API and parses the taxonomy hierarchy (based on the term set path, e.g., L0|#ParentTerm|L1|#ChildTerm) into a nested HTML structure.
The Metadata Requirement: Ensure your Term Set is properly mapped to a RefinableString managed property that contains the full path (WSSId). Without the path data, the front-end code cannot reconstruct the parent-child relationship.
If you aren't a developer, the 'workaround' is to create separate search verticals for each primary category, rather than trying to force a tree structure into a single filter panel. Anything else will be a circular path of trial-and-error.
Why the previous replies in this thread are incorrect/insufficient:
KasperLarsen (Iron Contributor): Incorrect. They suggested that the feature is simply in 'basic' or 'upcoming' status. In reality, the technical bottleneck is not a 'version' issue—it is an architectural one. Even in newer versions, the Search API will return flattened results unless custom logic is applied. They are promising a feature that the underlying platform cannot natively support without an API extension.
Jennifer Burback (Copper Contributor): Partial. While their workaround (using sub-pages and selectable items) works for navigation, it is not a 'search' solution. It fundamentally changes the user experience and is not a valid answer for someone trying to implement a filterable search refiner.
DaveMate84R (MVP): Correct on the 'why' (flat properties), but insufficient. They correctly identified that the hierarchy is lost, but they stopped at the problem without offering a technical path forward.