Problem/Motivation
I'm trying to subtly change the behavior of the hierarchical term facet so that when a child term is selected the parent is unselected. I built some custom logic using SearchApiSolrEvents::PRE_QUERY but it's resulting in the facet not displaying correctly, though the results appear to work correctly.
The goal behavior is as follows:
* I click through a term hierarchy, first selecting a top level item in the tree.
* The page reloads to show matching results, i.e. everything tagged with the top-level term.
* I click a child term of the first level item, i.e. narrowing the selection.
* The page reloads to show the parent item is now in an indeterminate state and the results only show items which are tagged with the child term.
* I click a child term of the second level item, i.e. narrowing the selection further
* The page reloads to show the parent and first level items are now in an indeterminate state and the results only show items which are tagged with the grand child term.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
TBD
Data model changes
n/a
Comments
Comment #2
damienmckennaHere's the code I'm using so far:
I thought this would work - the results seem to be correct, but the facet now only shows the child and its parent & grandparent terms.
Comment #3
damienmckennaI tried to build a process plugin to accomplish this but wasn't able to work out the correct approach.
In the meantime I built the following, which technically works but might not be the best way: