From 3213f78ff45b6a5a72d9828c4b94b5a1548896b8 Mon Sep 17 00:00:00 2001 From: LaRita Robinson Date: Mon, 8 Apr 2024 10:47:41 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Another=20fix=20to=20the=20solr?= =?UTF-8?q?=20connection=20(#2180)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix solr endpoint default issue https://github.com/samvera/hyku/issues/2177 * Fix spec * Override default connection Ideally we probably need to define our own valkyrie indexing adapter, but this should work as a temporary fix. --- .../indexing/solr/indexing_adapter_decorator.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lib/valkyrie/indexing/solr/indexing_adapter_decorator.rb diff --git a/lib/valkyrie/indexing/solr/indexing_adapter_decorator.rb b/lib/valkyrie/indexing/solr/indexing_adapter_decorator.rb new file mode 100644 index 000000000..387ac760d --- /dev/null +++ b/lib/valkyrie/indexing/solr/indexing_adapter_decorator.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +# Override Hyrax v5.0 to avoid incorrect default connection +# TODO: create and initialize a Hyku version of the indexing adapter +module Valkyrie + module Indexing + module Solr + module IndexingAdapterDecorator + def default_connection + ::SolrEndpoint.new.connection + end + end + end + end +end + +Valkyrie::Indexing::Solr::IndexingAdapter.prepend(Valkyrie::Indexing::Solr::IndexingAdapterDecorator)