I have some hierarchical data that I want to represent in the Solr UI (/browse). I've read through many discussions on this topic, including http://wiki.apache.org/solr/HierarchicalFaceting and http://packtlib.packtpub.com/library/9781849516068/ch06lvl1sec09 . However, I didn't see a solution that solves case.
For each facet field in my data, the depth varies depending on the facet term. For example, at the root level, facet term 1 may have 3 levels down, but facet term 2 will have 8 levels down. In the UI, I want to show only the facet terms at the currently selected level. Using the example that comes with Solr, the facet "cat" has the field "electronics", which then has several children. When my user initially enters the UI, he should only see "electronics"; he should not see any of its children until he clicks on "electronics". Programmatically, something like this might work: for each facet field, add another hidden field that identifies its parent. Then, program additional logic in the UI to show only the facet terms at the currently selected level. For example, if one filters on "cat:electronics", the new UI logic would apply the additional filter "cat_parent:electronics". Can this be done? Would it be a lot of work? Is there a better way? By the way, Flamenco (another faceted browser) has built-in support for hierarchies, and it has worked well for my data in this aspect (but less well than Solr in others). I'm looking for the same kind of hierarchical UI feature in Solr.