Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions conf/recordmanager.ini.sample.finna
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@
; Example for allowing IIIF json files.
;allowed_media_types[] = application/ld+json;profile="http://iiif.io/api/presentation/3/context.json"

; The following section can be used to change the Solr fields used when indexing
; records, particularly for hierarchical records. Any field can also be set to empty
; to disable it.
;[Solr Fields]
;container_title_facet =
14 changes: 14 additions & 0 deletions src/RecordManager/Finna/Solr/SolrUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

use RecordManager\Base\Record\AbstractRecord;

use function in_array;
use function intval;
use function is_callable;
use function strlen;
Expand Down Expand Up @@ -73,6 +74,19 @@ protected function augmentAndProcessFields(
$data['catalog_date'] = $date;
}
}
if (
$containerTitleFacetField = $this->config['Solr Fields']['container_title_facet']
?? 'container_title_str_mv'
) {
// Use hierarchy_top_title for ead and ead3 formats instead of hierarchy_parent_title.
if (in_array($record['format'], ['ead', 'ead3'])) {
if (isset($data['hierarchy_top_title'])) {
$data[$containerTitleFacetField] = (array)$data['hierarchy_top_title'];
}
} elseif ($this->hierarchyParentTitleField && isset($data[$this->hierarchyParentTitleField])) {
$data[$containerTitleFacetField] = (array)$data[$this->hierarchyParentTitleField];
}
}
$this->addSeriesKeys($data, $metadataRecord);
}

Expand Down
Loading
Loading