-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issue #127: Fixing issues in indexing version specific subfields
- Loading branch information
Showing
14 changed files
with
118 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
package de.gwdg.metadataqa.marc; | ||
|
||
import de.gwdg.metadataqa.marc.definition.MarcVersion; | ||
import de.gwdg.metadataqa.marc.model.SolrFieldType; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public interface Extractable { | ||
|
||
public Map<String, List<String>> getKeyValuePairs(); | ||
public Map<String, List<String>> getKeyValuePairs(SolrFieldType type); | ||
Map<String, List<String>> getKeyValuePairs(); | ||
Map<String, List<String>> getKeyValuePairs(SolrFieldType type); | ||
Map<String, List<String>> getKeyValuePairs(SolrFieldType type, MarcVersion marcVersion); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/test/java/de/gwdg/metadataqa/marc/cli/MarcToSolrTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package de.gwdg.metadataqa.marc.cli; | ||
|
||
import de.gwdg.metadataqa.marc.dao.DataField; | ||
import de.gwdg.metadataqa.marc.dao.Leader; | ||
import de.gwdg.metadataqa.marc.dao.MarcRecord; | ||
import de.gwdg.metadataqa.marc.definition.MarcVersion; | ||
import de.gwdg.metadataqa.marc.definition.tags.tags76x.Tag787; | ||
import de.gwdg.metadataqa.marc.model.SolrFieldType; | ||
import org.junit.Test; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.stream.Collectors; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
public class MarcToSolrTest { | ||
|
||
@Test | ||
public void testVersionSpecificSubfield() { | ||
MarcRecord marcRecord = new MarcRecord("010000011"); | ||
marcRecord.setLeader(new Leader("00860cam a22002774a 45 0")); | ||
marcRecord.addDataField(new DataField(Tag787.getInstance(), " ", " ","@", "japan")); | ||
Map<String, List<String>> solr = marcRecord.getKeyValuePairs(SolrFieldType.MIXED, false, MarcVersion.KBR); | ||
assertTrue(solr.containsKey("787x40_RelatedTo_language_KBR")); | ||
assertEquals(Arrays.asList("japan"), solr.get("787x40_RelatedTo_language_KBR")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters