Created
July 23, 2019 22:34
-
-
Save orangewolf/e9c57ba3f09035a7baffb9bcd76d91db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove orphan search records from a collection | |
search = ActiveFedora::SolrService.get("member_of_collection_ids_ssim: 6h440t714", rows: 100000); nil | |
search['response']['docs'].each do |doc| | |
if Work.where(id: doc['id']).blank? | |
ActiveFedora::SolrService.delete(doc['id']) | |
end | |
end; nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment