projectblacklight / blacklight

Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr) index.
http://projectblacklight.org/
Other
760 stars 256 forks source link

Default behavior of Advanced Search facet modal does not reflect expected multi-select behavior #3236

Open body-clock opened 4 months ago

body-clock commented 4 months ago

On the advanced search page, we render facets for the user to refine their search. These facet fields, unlike facet fields on basic search, allow for multi-select. When facets are limited (which they are by default), we are presented with a popup modal containing the remaining facet values that exist beyond the default limit. This works well for basic search, since only one value can be selected per-search. More can be applied, but a search is performed on every click.

On the advanced search page, this modal has the same behavior which stands in opposition to the modified facet multi-select behavior. In SearchWorks, this issue is avoided by using additional Solr params to unlimit facet values specifically on the advanced search form (this additional configuration is enabled by the use of an additional search builder step provided by the blacklight_advanced_search gem).

The clearest path forward is to modify the additional facet modal to support multi-select and disable the default search-on-click behavior. This can be achieved by creating an additional component, much like the FacetFieldCheckboxesComponent. This modification would greatly improve the default behavior of limited facet fields on the advanced search page.

body-clock commented 3 months ago
Screenshot 2024-08-12 at 10 09 17 AM

I was able to integrate a JS multiselect (I chose Tom Select because of its nice Bootstrap 5 theme) on the advanced search page. I could do a writeup or make a wiki page for this if anyone is interested.

jcoyne commented 3 months ago

@body-clock That's very nicely done. Writing that up as a wiki page would be excellent!

body-clock commented 1 month ago

Sorry this took me so long - I wrote up a wiki page that details my implementation here.