Test 'no snippets' deserialization
Change-Id: I2d0e51252d358b7d345f3b7c3f2654249e6d14b3
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 4eaa4db..d91e4f1 100644
--- a/src/test/java/de/ids_mannheim/korap/search/TestMetaFields.java
+++ b/src/test/java/de/ids_mannheim/korap/search/TestMetaFields.java
@@ -365,6 +365,19 @@
assertEquals("base/p", ks.getMeta().getContext().getSpanContext());
};
+
+ @Test
+ public void searchMetaAndSnippets () throws IOException {
+
+ // All fields
+ String jsonString = getJsonString(getClass()
+ .getResource("/queries/metas/no-snippets.jsonld")
+ .getFile());
+
+ Krill ks = new Krill(jsonString);
+ assertFalse(ks.getMeta().hasSnippets());
+ };
+
@Test
public void searchMetaAssets () throws IOException {
diff --git a/src/test/resources/queries/metas/no-snippets.jsonld b/src/test/resources/queries/metas/no-snippets.jsonld
new file mode 100644
index 0000000..f50e54b
--- /dev/null
+++ b/src/test/resources/queries/metas/no-snippets.jsonld
@@ -0,0 +1,103 @@
+{
+ "meta": {
+ "startIndex": 0,
+ "snippets": false,
+ "count": 50,
+ "cutOff": true,
+ "fields": [
+ "corpusSigle",
+ "textSigle",
+ "pubDate",
+ "pubPlace",
+ "availability",
+ "textClass"
+ ],
+ "timeout": 90000
+ },
+ "query": {
+ "@type": "koral:token",
+ "wrap": {
+ "@type": "koral:term",
+ "match": "match:eq",
+ "layer": "orth",
+ "key": "Sockenpuppe",
+ "foundry": "opennlp",
+ "rewrites": [
+ {
+ "@type": "koral:rewrite",
+ "src": "Kustvakt",
+ "operation": "operation:injection",
+ "scope": "foundry"
+ }
+ ]
+ }
+ },
+ "collection": {
+ "@type": "koral:docGroup",
+ "operation": "operation:and",
+ "operands": [
+ {
+ "operands": [
+ {
+ "@type": "koral:doc",
+ "match": "match:eq",
+ "type": "type:regex",
+ "value": "CC-BY.*",
+ "key": "availability"
+ },
+ {
+ "operands": [
+ {
+ "@type": "koral:doc",
+ "match": "match:eq",
+ "type": "type:regex",
+ "value": "ACA.*",
+ "key": "availability"
+ },
+ {
+ "operands": [
+ {
+ "@type": "koral:doc",
+ "match": "match:eq",
+ "type": "type:regex",
+ "value": "QAO-NC",
+ "key": "availability"
+ },
+ {
+ "@type": "koral:doc",
+ "match": "match:eq",
+ "type": "type:regex",
+ "value": "QAO.*",
+ "key": "availability"
+ }
+ ],
+ "@type": "koral:docGroup",
+ "operation": "operation:or"
+ }
+ ],
+ "@type": "koral:docGroup",
+ "operation": "operation:or"
+ }
+ ],
+ "@type": "koral:docGroup",
+ "operation": "operation:or"
+ },
+ {
+ "@type": "koral:doc",
+ "match": "match:eq",
+ "type": "type:regex",
+ "value": "W.D.*",
+ "key": "corpusSigle"
+ }
+ ],
+ "rewrites": [
+ {
+ "@type": "koral:rewrite",
+ "src": "Kustvakt",
+ "operation": "operation:insertion",
+ "scope": "availability(ALL)"
+ }
+ ]
+ },
+ "@context": "http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld"
+}
\ No newline at end of file