Unfortunately, I don’t think there is a simple solution to your problem – there is no explicit hierarchy in the “building” and “location” facets that would allow VuFind to know which ones it should or should not display under certain circumstances. It is simply summarizing the data available in the search results. For example, take a look at this single-record search:
This particular item is in both the Dykes and Farha libraries as well as belonging to the Farha A-V collection. The fact that you might select the “Dykes” library facet doesn’t change the fact that the record still belongs to the “Farha A-V” collection; similarly, the fact that you might select the “Farha A-V” collection doesn’t change the fact that another copy exists in the Dykes library.
Anyway, I’m not trying to say that what you are asking to do is wrong – I understand your thinking from a usability perspective – but it relies on relationship information which does not exist in the system. Unfortunately, that means that solving the problem would require some significant work on your part – you would need to create a database describing all of the building/location relationships, and you would need to edit the facet processing logic in the Solr SearchObject to filter the location values based on the selected building values.
There’s also a further complication – what if somebody selects multiple buildings? (i.e. suppose I want to find out which items exist at both Dykes and Farha). When the second building is selected, do some of the locations pop back into existence? Do you want to prevent the possibility of selecting multiple buildings? Is this potential inconsistency, along with the amount of work involved, enough justification to leave things as they are?
Sorry I don’t have an easier answer – and please let me know if anything is unclear or if you need more technical details.
On a much more positive note, congratulations on your launch! If you’re ready, you might want to add your instance to the installation list in the wiki:
From: Jason Stirnaman [mailto:firstname.lastname@example.org]
Sent: Tuesday, August 30, 2011 3:54 PM
Subject: [VuFind-Tech] only display Building facets that match applied Location filter
How can I display only Building (or in our case "Collection") facet options that only correspond to whichever Location (="Library") filter is currently applied? We're adding a 999 for each holding statement. In order to populate the Library field I'm just using the SolrMarc mapping to map Dykes.* from the holdings statement to Dykes Library (Kansas City) in Library.
Here's an example:
If I select Dykes Library as the Library, then I don't want to see Farha values in my Collection facet.
I looked at the Consortia support issue and the attached library location patch. I'm wondering if the added filtering it does in SearchObject/solr.php is what we need, but I don't think we really want to store the Location in the session.
PS We've just rolled out our new VuFind catalog. We have much work still to do, but it's been well-received and mostly painless. Much thanks to Demian and everyone who's contributed to the list, documentation, and code!
Biomedical Librarian, Digital Projects
A.R. Dykes Library, University of Kansas Medical Center