Skip to content

Commit

Permalink
Remove unused write_to_index override
Browse files Browse the repository at this point in the history
Upstream method moved to solr_loader.rb
  • Loading branch information
eliotjordan committed Sep 30, 2021
1 parent 7b0c253 commit 3ebf451
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions app/models/iiif_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,25 +89,6 @@ def document_ids
solr_documents.map { |y| y[:id] }
end

# If the document is being reindexed, it will have a noid. Reporting the
# noid makes it easier to find
def document_ids_with_noids
solr_documents.map { |y| "(id: #{y[:id]}, noid: #{noid})" }
end

def write_to_index(batch)
documents = documents_that_have_ids(batch)
return unless write? && documents.present?

blacklight_solr.update data: documents.to_json,
headers: { 'Content-Type' => 'application/json' }
rescue RSolr::Error::Http => e
error_message = "Failed to update Solr for the following documents: #{document_ids_with_noids.join(', ')}"
Rails.logger.error error_message
Rails.logger.error "RSolr error message: #{e.message}"
raise IndexingError, error_message
end

# Override hard commit after indexing every document, for performance.
def commit; end
end

0 comments on commit 3ebf451

Please sign in to comment.