Skip to content

Commit

Permalink
format rake message. datacite/datacite#1134
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Oct 24, 2020
1 parent 813690b commit b63e7be
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/models/concerns/indexable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,13 @@ def delete_by_query(options={})
return "ENV['QUERY'] is required" if options[:query].blank?

client = Elasticsearch::Model.client
client.delete_by_query(index: options[:index], q: options[:query])
response = client.delete_by_query(index: options[:index], q: options[:query])

if response.to_h["deleted"]
"Deleted #{response.to_h["deleted"].to_i} DOIs."
else
"An error occured deleting DOIs for query #{options[:query]}."
end
end

def doi_from_url(url)
Expand Down

0 comments on commit b63e7be

Please sign in to comment.