Should we get rid of Blacklight? #1157
srerickson
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Should we get rid of Blacklight?
Background
Blacklight is a Rails engine that serves as the primary interface to Solr. It essentially takes an ad hoc query, formulates it into a Solr query, retrieves the results, and displays them in the UI. Being a "Rails engine" means that includes specific types of Rails components, such as controllers, models, views, and other classes, that are used in the context of another Rails application. In a sense, a Rails engine is like a mini-Rails app that's contained inside a larger Rails app. This makes them more embedded than a typical Ruby gem, but that doesn't mean they can't be replaced.
Usage in Scholarsphere
Blacklight's impact in Scholarsphere is fairly limited mostly because Scholarsphere isn't a library catalog and a lot of the additional features that Blacklight provides aren't necessary for Scholarsphere. The features of Blacklight that Scholarsphere requires are:
There are a handful of other bits, such as some frontend code for loading facets and rendering modals, but this is all based off of Bootstrap and is easily replacement with our own customized code which can be based off of Bootstrap as well.
Options for Replacement
Keeping Solr
We can remove Blacklight and still retain Solr.
Replace CatalogController
We're only using an
index
action that builds lists of works and paginates through them. All of the field configuration for display that's in Blacklight's CatalogController can just be off-loaded and hard-coded in the views. The configuring of search fields, where you search an individual field, will need some thought. That might be better served as a component, or service class that builds the required Solr query from a given input.Replace Search Builder Classes
These are the classes that construct the Solr queries. The way Blacklight has architects these is by using a "processor chain" than builds up a series of filter queries, i.e. the
:fq
parameters.Replace Facet Features
There are separate controllers for rendering and paginating through facets that would need to be replaced as well.
Remove Solr
It's worth exploring the option of re-writing the search interface to use PostGres. It's not clear that Scholarsphere needs a relevance-ranked search. Boolean matching on title, contributor, and a few other fields might suffice. Facets could be re-implemented as well since they are mostly focused on enums in the database.
One avenue that would be exciting to explore is the GraphQL endpoint. If the search is re-imagined, using the endpoint would align API and UI searching features, meaning that users would see the same results from the UI as they would in the API. The UI would render the same search results async using React components, whereas the API would just return JSON, or users could use their own GraphQL clients.
Beta Was this translation helpful? Give feedback.
All reactions