BiologicalRecordsCentre / ukotas

UK Overseas Territories Alien Species website work - https://dev-ceh-ukotas.pantheonsite.io/
GNU General Public License v3.0
0 stars 0 forks source link

Implement a faceted search. #34

Open johnvanbreda opened 5 days ago

johnvanbreda commented 5 days ago

Follows on from #12.

Add a faceted search tool as an alternative/replacement for the standard species browser which allows browsing via taxonomy, territory and global search as now, but also by other fields in the species account such as impact. A good example is https://www.iucnredlist.org/search. Functionality similar to this can be achieved using the Drupal Facets module.

johnvanbreda commented 2 days ago

@StephRorke @DavidRoy there is a rough draft of a new browse tool on the searchdev version of the site - via the territory icon links on https://searchdev-ceh-ukotas-d10.pantheonsite.io. This is not complete yet as I've only implemented some of the facets, but please can I have some feedback to confirm this is on the right lines before I start properly building on the live site?

I have configured the facets in the left column to show a "no values" message if they are empty - in reality we probably want only the active facets to appear, so I'll change this on the live version. Also note that the tool currently requires a page load when you change a value for a search facet - AJAX is supported by the underlying module which removes the need to reload the entire page, but it is unfortunately very buggy (there is a long list of issues and patches around this - see https://www.drupal.org/project/facets/issues/3075378).

StephRorke commented 2 days ago

@johnvanbreda I've had a quick look at this and yes most definitely along the lines I was expecting. Will it be possible to have the global search as available here: https://searchdev-ceh-ukotas-d10.pantheonsite.io/browse-species working alongside the facet search functionality? I think only showing active facets would be beneficial if it doesn't cause long refresh times

johnvanbreda commented 2 days ago

@StephRorke there is a version of the faceted search now on the live site at https://live-ceh-ukotas-d10.pantheonsite.io/species-browser. I can swap it for the one you get when you click on a territory flag on the home page once you've checked it's OK. It includes an updated global search as well as hiding facets that have no options.