pulibrary / orangelight

PUL Blacklight Project (Ruby 3.1.0, Rails 7.1.4)
21 stars 7 forks source link

Classification facet shows only the top 10 level classifications #2814

Closed christinach closed 1 week ago

christinach commented 2 years ago

Reported by Martin H. Not all classifications are listed in the classification facet. For example 'Z' is missing.

https://github.com/pulibrary/orangelight/blob/2b7f62c034b65a15157013e284f4e968dfb654f4/app/controllers/catalog_controller.rb#L137

Implementation notes

Try adding limit: true to this facet in the catalog controller

kevinreiss commented 2 years ago

See if there as a way to manipulate the number of categories shown or add a "more" option to a pivot facet.

christinach commented 3 months ago

Check in google analytics to see how many users use this feature.

caroldh commented 3 months ago

Can all classifications be listed (more than 10) or if not, user will see a "more" option at bottom of list?

maxkadel commented 2 weeks ago

@rladdusaw will write up conclusions and we will look at in technical discussion on Friday

rladdusaw commented 2 weeks ago

Pivot facets seem to work differently than standard facets and don't appear to respect the limit config value. They also do not create a field in solr for the pivot facet, only the two facets used to create the pivot facet can be found in solr.

In order for a facet to have the "more" link and paginate the fields blacklight has to make a query to solr and find more available fields than the maximum number of displayed fields, but since there is not a solr field for the pivot facet it can only find the default limit of 10 fields, and does not display the "more" link.

Even if you set the limit to a smaller number to force the "more" link to appear the attempt to retrieve the paginated fields fails since it tries to get the data from an endpoint for the pivot facet that does not exist like /catalog/facet/classification_pivot_field, which attempts to query solr for the facet and is unable to find a solr field for the pivot facet and it causes a 500.

maxkadel commented 1 week ago

Trying Blacklight Hierarchy gem from Stanford, which Cornell also uses.

maxkadel commented 1 week ago

Hierarchy gem is looking like it does what we need, but it does require a new field in Solr.

maxkadel commented 1 week ago

@rladdusaw will create a ticket in Bibdata for the new fields needed in Solr