From 6127784e6764d0d53f0cf664c7ae6aac5ee64157 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Thu, 18 Jul 2019 06:55:22 +0200 Subject: [PATCH] update affiliation format. datacite/schema#56 --- app/models/doi.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/doi.rb b/app/models/doi.rb index 24bca9259..e44acf1b2 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -848,7 +848,7 @@ def set_defaults def self.convert_affiliations logger = Logger.new(STDOUT) - response = Doi.query("creators.affiliation:* -creators.affiliation.name:*", page: { size: 1, cursor: [] }) + response = Doi.query("creators.affiliation:*", page: { size: 1, cursor: [] }) logger.info "#{response.results.total} DOIs found that have the affiliation in the old format." if response.results.total > 0 @@ -856,7 +856,7 @@ def self.convert_affiliations cursor = [] while response.results.results.length > 0 do - response = Doi.query("creators.affiliation:* -creators.affiliation.name:*", page: { size: 1000, cursor: cursor }) + response = Doi.query("creators.affiliation:*", page: { size: 1000, cursor: cursor }) break unless response.results.results.length > 0 logger.info "[Affiliation] Updating #{response.results.results.length} DOIs starting with _id #{response.results.to_a.first[:_id]}."