You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 17, 2026. It is now read-only.
Paul Danelli edited this page Feb 18, 2022
·
2 revisions
Querying Solr is much faster than querying Fedora, so this is advisable in almost all circumstances. By using the ActiveFedora::SolrSerice you can run queries and then if necessary turn the records back into Hyrax Works via an additional find query.
# Example query looks for all works with a creator using the email providedquery_string="generic_type_sim:Work AND (creator_tesim:\"*#{email}*\")"docs=ActiveFedora::SolrService.get(query_string,rows: 1_000_000).dig("response","docs")# Simple SolrHit wrapperdocs.map{ |doc| ActiveFedora::SolrHit.new(doc)}
You could also use the reify method to turn the SolrHit into the correct work:
One thing to note however, is that this will take the work UUID from the SolrHit and perform an ActiveFedora::find(id) query for each of them, which is going to be very slow.