diff --git a/app/graphql/elasticsearch_loader.rb b/app/graphql/elasticsearch_loader.rb index 6a8714c90..c62611b80 100644 --- a/app/graphql/elasticsearch_loader.rb +++ b/app/graphql/elasticsearch_loader.rb @@ -6,7 +6,11 @@ def initialize(model) end def perform(ids) - @model.find_by_id(ids).results.each { |record| fulfill(record.uid, record) } + if @model.name == "Doi" + @model.find_by_id(ids).results.each { |record| fulfill(record.uid, record) } + else + @model.find_by_id(ids).records.each { |record| fulfill(record.uid, record) } + end ids.each { |id| fulfill(id, nil) unless fulfilled?(id) } end end