mlibrary/heliotrope

Replace Fedora calls with Solr calls where possible

Closed this issue · 0 comments

There are a few places where we're using fedora when I think we can use solr, specifically when building presenters

https://github.com/mlibrary/heliotrope/blob/master/app/controllers/webgls_controller.rb#L11
https://github.com/mlibrary/heliotrope/blob/master/app/controllers/e_pubs_controller.rb#L78

In both those cases we just need a solr doc to build the presenter so there's no reason for going to fedora (FileSet.find('id')) which is more expensive.

There are a few in factory_service.rb as well:

https://github.com/mlibrary/heliotrope/blob/master/app/services/factory_service.rb#L196

There are different approaches to this. Here's a fun one we could try:

https://github.com/mlibrary/heliotrope/blob/master/app/models/file_set.rb#L140

Or an old standby, something like:

ActiveFedora::SolrService.query("{!terms f=id}#{id}", rows: 1).first