lib/ddr/models/indexing.rb in ddr-models-1.5.0 vs lib/ddr/models/indexing.rb in ddr-models-1.6.0
- old
+ new
@@ -10,13 +10,18 @@
def index_fields
fields = {
Ddr::IndexFields::TITLE => title_display,
Ddr::IndexFields::INTERNAL_URI => internal_uri,
Ddr::IndexFields::IDENTIFIER => identifier_sort,
- Ddr::IndexFields::PERMANENT_ID => permanent_id,
Ddr::IndexFields::WORKFLOW_STATE => workflow_state
}
+ if permanent_id.present?
+ fields[Ddr::IndexFields::PERMANENT_ID] = permanent_id
+ end
+ if permanent_url.present?
+ fields[Ddr::IndexFields::PERMANENT_URL] = permanent_url
+ end
if respond_to? :fixity_checks
last_fixity_check = fixity_checks.last
fields.merge!(last_fixity_check.to_solr) if last_fixity_check
end
if respond_to? :virus_checks
@@ -48,6 +53,6 @@
identifier.first
end
end
end
-end
\ No newline at end of file
+end