Skip to content

Instantly share code, notes, and snippets.

@jcoyne
Last active February 23, 2016 20:30
Show Gist options
  • Select an option

  • Save jcoyne/4724985af01cf12bad1e to your computer and use it in GitHub Desktop.

Select an option

Save jcoyne/4724985af01cf12bad1e to your computer and use it in GitHub Desktop.
Person.find_in_batches({ }, fl: 'id') do |group|
group.each do |hit|
begin
puts "Got #{hit['id']}"
ActiveFedora::Base.find(hit['id'])
rescue ActiveFedora::ObjectNotFoundError
puts " couldn't be found"
rescue Ldp::Gone
ActiveFedora::Base.logger.error "Although #{hit['id']} was found in Solr, it doesn't seem to exist in Fedora. The index is out of synch." if ActiveFedora::Base.logger
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment