diff --git a/app/models/doi.rb b/app/models/doi.rb index 881352726..e6ec91466 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -600,6 +600,7 @@ def as_indexed_json(_options = {}) "provider_id" => provider_id, "consortium_id" => consortium_id, "resource_type_id" => resource_type_id, + "person_id" => person_id, "client_id_and_name" => client_id_and_name, "provider_id_and_name" => provider_id_and_name, "resource_type_id_and_name" => resource_type_id_and_name, @@ -668,6 +669,7 @@ def as_indexed_json(_options = {}) "version_ids" => version_ids, "version_of_ids" => version_of_ids, "primary_title" => Array.wrap(primary_title), + "related_doi" => related_dois, "publisher_obj" => publisher, } end diff --git a/app/models/doi/indexer/related_doi_indexer.rb b/app/models/doi/indexer/related_doi_indexer.rb index eb97419d3..e81c049f7 100644 --- a/app/models/doi/indexer/related_doi_indexer.rb +++ b/app/models/doi/indexer/related_doi_indexer.rb @@ -3,12 +3,12 @@ module Doi::Indexer class RelatedDoiIndexer def initialize(related_identifiers) - @related_identifiers = related_identifiers + @related_identifiers = Array.wrap(related_identifiers) @related_dois = nil end def related_dois - @related_dois ||= @related_identifiers.select { |r| r["relatedIdentifierType"] == "DOI" } + @related_dois ||= @related_identifiers.select { |r| r.fetch("relatedIdentifierType", nil) == "DOI" } end def related_grouped_by_id