Updated default fields
Change-Id: I97714134e7c7212794528c65ad387241a5648ea1
diff --git a/Changes b/Changes
index d9ed869..a562e4c 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,4 @@
-0.52 2015-06-23
+0.52 2015-06-24
- [bugfix] Fixed payload filtering in FocusSpans (margaretha)
- [workaround] Reintroduced empty collection support,
as Koral still creates them (diewald)
@@ -8,6 +8,7 @@
- [bugfix] Fixed sequence deserialization bug for simple unordered
constraint (diewald)
- [bugfix] Mirror collection (diewald)
+ - [bugfix] Updated default fields for meta data (diewald)
0.51 2015-03-17
- This is a major version (prepared for the GitHub release)
diff --git a/src/main/java/de/ids_mannheim/korap/KrillMeta.java b/src/main/java/de/ids_mannheim/korap/KrillMeta.java
index b1023c2..2b7cf85 100644
--- a/src/main/java/de/ids_mannheim/korap/KrillMeta.java
+++ b/src/main/java/de/ids_mannheim/korap/KrillMeta.java
@@ -39,11 +39,28 @@
{
fields = new HashSet<String>(16);
+ // TODO: Support @all
+
// Lift following fields per default
// These fields are chosen for <legacy /> reasons
- for (String field : new String[] { "ID", "UID", "textSigle",
- "corpusID", "author", "title", "subTitle", "textClass",
- "pubPlace", "pubDate", "foundries", "layerInfo", "tokenization" }) {
+ for (String field : new String[] {
+ "ID",
+ "UID",
+ "textSigle",
+ "corpusID",
+ "author",
+ "title",
+ "subTitle",
+ "textClass",
+ "pubPlace",
+ "pubDate",
+ "foundries",
+ "layerInfos",
+ "tokenization",
+ // New:
+ "docSigle",
+ "corpusSigle",
+ }) {
fields.add(field);
};
diff --git a/src/test/java/de/ids_mannheim/korap/search/TestMetaFields.java b/src/test/java/de/ids_mannheim/korap/search/TestMetaFields.java
index 490148b..d121281 100644
--- a/src/test/java/de/ids_mannheim/korap/search/TestMetaFields.java
+++ b/src/test/java/de/ids_mannheim/korap/search/TestMetaFields.java
@@ -28,7 +28,7 @@
@RunWith(JUnit4.class)
public class TestMetaFields {
-
+
@Test
public void searchMetaFields () throws IOException {
@@ -56,18 +56,18 @@
JsonNode res = mapper.readTree(kr.toJsonString());
assertEquals(0, res.at("/matches/0/UID").asInt());
assertEquals("WPD", res.at("/matches/0/corpusID").asText());
- assertEquals("", res.at("/matches/0/docID").asText());
- assertEquals("", res.at("/matches/0/textSigle").asText());
- assertEquals("", res.at("/matches/0/ID").asText());
- assertEquals("", res.at("/matches/0/author").asText());
- assertEquals("", res.at("/matches/0/title").asText());
- assertEquals("", res.at("/matches/0/subTitle").asText());
- assertEquals("", res.at("/matches/0/textClass").asText());
- assertEquals("", res.at("/matches/0/pubPlace").asText());
- assertEquals("", res.at("/matches/0/pubDate").asText());
- assertEquals("", res.at("/matches/0/foundries").asText());
- assertEquals("", res.at("/matches/0/layerInfo").asText());
- assertEquals("", res.at("/matches/0/tokenization").asText());
+ assertTrue(res.at("/matches/0/docID").isMissingNode());
+ assertTrue(res.at("/matches/0/textSigle").isMissingNode());
+ assertTrue(res.at("/matches/0/ID").isMissingNode());
+ assertTrue(res.at("/matches/0/author").isMissingNode());
+ assertTrue(res.at("/matches/0/title").isMissingNode());
+ assertTrue(res.at("/matches/0/subTitle").isMissingNode());
+ assertTrue(res.at("/matches/0/textClass").isMissingNode());
+ assertTrue(res.at("/matches/0/pubPlace").isMissingNode());
+ assertTrue(res.at("/matches/0/pubDate").isMissingNode());
+ assertTrue(res.at("/matches/0/foundries").isMissingNode());
+ assertTrue(res.at("/matches/0/layerInfos").isMissingNode());
+ assertTrue(res.at("/matches/0/tokenization").isMissingNode());
jsonString = getString(getClass().getResource(
"/queries/metas/fields_2.jsonld").getFile());
@@ -80,7 +80,7 @@
mapper = new ObjectMapper();
res = mapper.readTree(kr.toJsonString());
assertEquals(0, res.at("/matches/0/UID").asInt());
- assertEquals("", res.at("/matches/0/corpusID").asText());
+ assertTrue(res.at("/matches/0/corpusID").isMissingNode());
assertEquals("Ruru,Jens.Ol,Aglarech", res.at("/matches/0/author")
.asText());
assertEquals("A", res.at("/matches/0/title").asText());