Hyrax v3.0 ( branch: )

Writing Custom Queries

We had a method that searched solr for a field with a particular value. This originally used ActiveFedora::Base #where method. It was converted to a Valkyrie Custom Query and saved in app/services/custom_queries/find_by_identifier.rb.

The custom query was registered in config/intializers/wings.rb.

require 'wings'
query_registration_target = Valkyrie.config.metadata_adapter.query_service.custom_queries
[CustomQueries::FindPublicationByIdentifier].each do |handler|
  query_registration_target.register_query_handler(handler)
end