samvera-labs / nurax-pg

This is a Hyrax application configured to use Postgres for metadata storage instead of ActiveFedora.
Apache License 2.0
0 stars 0 forks source link

dependent on ActiveFedora::SolrService #26

Open elrayle opened 2 years ago

elrayle commented 2 years ago

Observed Issues:

Exploration

Confirmed consistent configuration of solr urls in:

path gem that uses it
config/blacklight.yml expected for Blacklight search builders
config/solr.yml expected by ActiveFedora for ActiveFedora::SolrService
config/valkyrie_index.yml expected by Valkyrie indexers

_NOTE: The values of SOLR_URL and VALKYRIE_SOLR_HOST/PORT/CORE are defined as environment variables in .env for development._

See PR #21 which was used to help diagnose which config was defining the observed solr core.

Temporary Solution

It turned out that if config/fedora.yml is not present (and it is not in nurax-pg), then ActiveFedora uses its default solr.yml. To avoid this, added the following configuration to the end of config/initializers/hyrax.rb in nurax-pg to define the path to the solr.yml config that sets up the correct solr core.

ActiveFedora.init(solr_config_path: Rails.root.join('config', 'solr.yml'))
elrayle commented 2 years ago

This addresses the issue in nurax-pg to use the correct core when ActiveFedora::SolrService is used. Long term, this should be using Hyrax:SolrService.

Leaving this open to track the transition to Hyrax::SolrService.

Related Work

TODO: Create a Hyrax issue to track this work.