Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes more solr uri issues #2182

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions lib/valkyrie/indexing/solr/indexing_adapter_decorator.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
# frozen_string_literal: true

# Override Hyrax v5.0 to avoid incorrect default connection
# Override Hyrax v5.0 to avoid incorrect default connection. Because of the way
# Hyku uses SolrEndpoint, the configuration isn't always appropriate. At times,
# it falls back into the Valkyrie IndexingAdapter instead of Hyrax's, and
# loses the connection.
# TODO: create and initialize a Hyku version of the indexing adapter
module Valkyrie
module Indexing
module Solr
module IndexingAdapterDecorator
##
# @param connection [RSolr::Client] The RSolr connection to index to.
def initialize(connection: ::SolrEndpoint.new.connection)
@connection = connection
end

def default_connection
::SolrEndpoint.new.connection
@connection = ::SolrEndpoint.new.connection
end

def add_documents(*args)
self.connection = default_connection
super(*args)
end
end
end
Expand Down
Loading