Fixed missing cutOff.

Change-Id: Iaabbac9097db8b8941f7a432c224ccdd07975c31
diff --git a/pom.xml b/pom.xml
index ebbc721..354f8bd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -356,7 +356,7 @@
         <dependency>
             <groupId>de.ids_mannheim.korap</groupId>
             <artifactId>Krill</artifactId>
-            <version>0.55.7</version>
+            <version>0.55.8</version>
             <exclusions>
                 <exclusion>
                     <groupId>org.xerial</groupId>
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java b/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java
index 39ef339..b8914df 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java
@@ -520,7 +520,7 @@
         meta.setSpanContext(ctx);
         meta.addEntry("count", pageLength);
         // todo: what happened to cutoff?
-        meta.addEntry("cutoff", cutoff);
+        meta.addEntry("cutOff", cutoff);
         // meta.addMeta(pageIndex, pageInteger, pageLength, ctx, cutoff);
         // fixme: should only apply to CQL queries per default!
         // meta.addEntry("itemsPerResource", 1);
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/SearchServiceTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/SearchServiceTest.java
index 6e4440f..94cc478 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/full/SearchServiceTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/SearchServiceTest.java
@@ -3,6 +3,7 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Iterator;
 import java.util.Set;
@@ -65,6 +66,30 @@
         assertEquals(6218, node.at("/meta/totalResults").asInt());
     }
 
+
+    @Test
+    public void testSearchQueryWithMeta () {
+        ClientResponse response = resource().path(getAPIVersion())
+                .path("search").queryParam("q", "[orth=der]")
+                .queryParam("ql", "poliqarp").queryParam("cutoff", "true")
+                .queryParam("count", "5")
+                .queryParam("page", "1")
+                .queryParam("context", "40-t,30-t").get(ClientResponse.class);
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+        String ent = response.getEntity(String.class);
+        JsonNode node = JsonUtils.readTree(ent);
+        assertNotNull(node);
+        assertTrue(node.at("/meta/cutOff").asBoolean());
+        assertEquals(5, node.at("/meta/count").asInt());
+        assertEquals(0, node.at("/meta/startIndex").asInt());
+        assertEquals("token", node.at("/meta/context/left/0").asText());
+        assertEquals(40, node.at("/meta/context/left/1").asInt());
+        assertEquals(30, node.at("/meta/context/right/1").asInt());
+        assertEquals(-1,node.at("/meta/totalResults").asInt());
+    }
+
+
     @Test
     public void testSearchQueryAuthorized () {
         ClientResponse response = resource().path(getAPIVersion())
@@ -107,6 +132,7 @@
         assertEquals("koral:token", node.at("/query/@type").asText());
     }
 
+
     @Test
     public void testSearchForPublicCorpusWithStringId () {
         ClientResponse response = resource().path(getAPIVersion())
@@ -124,7 +150,8 @@
         assertNotEquals(0, node.path("matches").size());
         assertEquals(32, node.at("/meta/totalResults").asInt());
     }
-    
+
+
     @Test
     public void testSearchForVirtualCollectionWithStringId () {
         ClientResponse response = resource().path(getAPIVersion())
@@ -138,12 +165,12 @@
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
         assertEquals("koral:docGroup", node.at("/collection/@type").asText());
-        assertEquals("operation:and", node.at("/collection/operation").asText());
+        assertEquals("operation:and",
+                node.at("/collection/operation").asText());
         assertNotEquals(0, node.at("/collection/operands").size());
         assertEquals("corpusSigle",
                 node.at("/collection/operands/0/key").asText());
-        assertEquals("GOE",
-                node.at("/collection/operands/0/value").asText());
+        assertEquals("GOE", node.at("/collection/operands/0/value").asText());
         assertEquals("creationDate",
                 node.at("/collection/operands/1/key").asText());
         assertEquals("1810-01-01",
@@ -151,28 +178,28 @@
         assertEquals(1, node.at("/meta/totalResults").asInt());
     }
 
-    
+
     @Test
-    public void testSearchForPublicCorpusWithIntegerId () throws KustvaktException {
+    public void testSearchForPublicCorpusWithIntegerId ()
+            throws KustvaktException {
         Set<Corpus> publicCorpora = ResourceFinder.searchPublic(Corpus.class);
         Iterator<Corpus> i = publicCorpora.iterator();
         String id = null;
-        while (i.hasNext()){
+        while (i.hasNext()) {
             Corpus c = i.next();
-            if (c.getName().equals("Goethe")){
-                id =c.getId().toString();
+            if (c.getName().equals("Goethe")) {
+                id = c.getId().toString();
             }
         }
-            
+
         ClientResponse response = resource().path(getAPIVersion())
-                .path("corpus").path(id).path("search")
-                .queryParam("q", "blau").queryParam("ql", "poliqarp")
-                .get(ClientResponse.class);
-        
+                .path("corpus").path(id).path("search").queryParam("q", "blau")
+                .queryParam("ql", "poliqarp").get(ClientResponse.class);
+
         String ent = response.getEntity(String.class);
         assertEquals(ClientResponse.Status.OK.getStatusCode(),
                 response.getStatus());
-        
+
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
         assertEquals("koral:doc", node.at("/collection/@type").asText());
@@ -180,7 +207,8 @@
         assertEquals("GOE", node.at("/collection/value").asText());
         assertNotEquals(0, node.path("matches").size());
     }
-    
+
+
     @Test
     public void testSearchForCorpusWithStringIdUnauthorized () {
         ClientResponse response = resource().path(getAPIVersion())
@@ -195,13 +223,13 @@
         assertEquals("[Cannot found public resources with ids: [WPD15]]",
                 error.get(2).asText());
     }
-    
+
+
     @Test
     public void testSearchForOwnersCorpusWithStringId () {
         ClientResponse response = resource().path(getAPIVersion())
                 .path("corpus").path("WPD15").path("search")
-                .queryParam("q", "[orth=das]")
-                .queryParam("ql", "poliqarp")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
                 .header(Attributes.AUTHORIZATION,
                         BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
                 .get(ClientResponse.class);
@@ -215,26 +243,28 @@
         assertEquals("WPD15", node.at("/collection/value").asText());
         assertNotEquals(0, node.path("matches").size());
     }
-    
+
+
     @Test
-    public void testSearchForOwnersCorpusWithIntegerId () throws KustvaktException {
-        
-        User kustvaktUser =  ((EntityHandlerIface) helper().getBean(ContextHolder.KUSTVAKT_USERDB))
-            .getAccount("kustvakt");
-        Set<Corpus> userCorpora = ResourceFinder.search(kustvaktUser, Corpus.class);
+    public void testSearchForOwnersCorpusWithIntegerId ()
+            throws KustvaktException {
+
+        User kustvaktUser = ((EntityHandlerIface) helper()
+                .getBean(ContextHolder.KUSTVAKT_USERDB)).getAccount("kustvakt");
+        Set<Corpus> userCorpora = ResourceFinder.search(kustvaktUser,
+                Corpus.class);
         Iterator<Corpus> i = userCorpora.iterator();
         String id = null;
-        while (i.hasNext()){
+        while (i.hasNext()) {
             Corpus c = i.next();
-            if (c.getPersistentID().equals("WPD15")){
-                id =c.getId().toString();
-//                System.out.println("Corpus "+id);
+            if (c.getPersistentID().equals("WPD15")) {
+                id = c.getId().toString();
+                //                System.out.println("Corpus "+id);
             }
         }
         ClientResponse response = resource().path(getAPIVersion())
                 .path("corpus").path(id).path("search")
-                .queryParam("q", "[orth=das]")
-                .queryParam("ql", "poliqarp")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
                 .header(Attributes.AUTHORIZATION,
                         BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
                 .get(ClientResponse.class);
@@ -249,6 +279,7 @@
         assertNotEquals(0, node.path("matches").size());
     }
 
+
     @Test
     public void testSearchSentenceMeta () {
         ClientResponse response = resource().path(getAPIVersion())