mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
Merge pull request #9326 from toniprieto/no-index-virtual-metadata
Avoid index virtual metadata in Solr Authority core
This commit is contained in:
@@ -80,7 +80,15 @@ public class DSpaceAuthorityIndexer implements AuthorityIndexerInterface, Initia
|
||||
throws SQLException, AuthorizeException {
|
||||
List<AuthorityValue> values = new ArrayList<>();
|
||||
for (String metadataField : metadataFields) {
|
||||
List<MetadataValue> metadataValues = itemService.getMetadataByMetadataString(item, metadataField);
|
||||
|
||||
String[] fieldParts = metadataField.split("\\.");
|
||||
String schema = (fieldParts.length > 0 ? fieldParts[0] : null);
|
||||
String element = (fieldParts.length > 1 ? fieldParts[1] : null);
|
||||
String qualifier = (fieldParts.length > 2 ? fieldParts[2] : null);
|
||||
|
||||
// Get metadata values without virtual metadata
|
||||
List<MetadataValue> metadataValues = itemService.getMetadata(item, schema, element, qualifier, Item.ANY,
|
||||
false);
|
||||
for (MetadataValue metadataValue : metadataValues) {
|
||||
String content = metadataValue.getValue();
|
||||
String authorityKey = metadataValue.getAuthority();
|
||||
|
Reference in New Issue
Block a user