Skip to content

Commit 9431ab6

Browse files
authored
[FINNA-3977] LidoSkosmosEnrichment: Support enriching author and secondary author names (#184)
1 parent 4a5b48c commit 9431ab6

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

src/RecordManager/Base/Enrichment/LidoSkosmosEnrichment.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,37 @@
4242
*/
4343
class LidoSkosmosEnrichment extends SkosmosEnrichment
4444
{
45+
/**
46+
* Default fields to enrich. Key is the method in driver and value is array
47+
* - pref, preferred field in solr
48+
* - alt, alternative field in solr
49+
* - check, check field for existing values
50+
*
51+
* @var array<string, array>
52+
*/
53+
protected $defaultFields = [
54+
'getRawTopicIds' => [
55+
'pref' => 'topic_add_txt_mv',
56+
'alt' => 'topic_alt_txt_mv',
57+
'check' => 'topic',
58+
],
59+
'getRawGeographicTopicIds' => [
60+
'pref' => 'geographic_add_txt_mv',
61+
'alt' => 'geographic_alt_txt_mv',
62+
'check' => 'geographic',
63+
],
64+
'getAuthorIds' => [
65+
'pref' => 'author',
66+
'alt' => 'author_variant',
67+
'check' => 'author',
68+
],
69+
'getSecondaryAuthorIds' => [
70+
'pref' => 'author2',
71+
'alt' => 'author2_variant',
72+
'check' => 'author2',
73+
],
74+
];
75+
4576
/**
4677
* Enrich the record and return any additions in solrArray
4778
*

src/RecordManager/Base/Record/Lido.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,26 @@ public function getRawGeographicTopicIds(): array
432432
return [];
433433
}
434434

435+
/**
436+
* Get author identifiers
437+
*
438+
* @return array<int, string>
439+
*/
440+
public function getAuthorIds(): array
441+
{
442+
return [];
443+
}
444+
445+
/**
446+
* Get secondary author identifiers
447+
*
448+
* @return array<int, string>
449+
*/
450+
public function getSecondaryAuthorIds(): array
451+
{
452+
return [];
453+
}
454+
435455
/**
436456
* Return subject identifiers associated with object.
437457
*

0 commit comments

Comments
 (0)