diff --git a/Changes b/Changes
index 3893aa6..06cc8b4 100644
--- a/Changes
+++ b/Changes
@@ -3,6 +3,8 @@
 - Add institution & landingPage to the resource web-service (#777)
 - Make URL mandatory for plugin registration (#573)
 - Remove hidden group from test database
+- Implemented QueryContextRewrite (#755)  
+
 
 # version 0.75
 
diff --git a/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java b/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
index 1647e41..e6d2fca 100644
--- a/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
+++ b/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
@@ -47,7 +47,7 @@
 
     public final static Logger log = LoggerFactory
             .getLogger(KustvaktConfiguration.class);
-    
+
     private String vcInCaching;
 
     private String indexDir;
@@ -58,6 +58,9 @@
 
     private String serverHost;
 
+    private int maxTokenContext;
+    private int maxTokenMatch;
+
     private int maxhits;
     private int returnhits;
     private String keystoreLocation;
@@ -224,6 +227,9 @@
         // cache
         totalResultCacheEnabled = Boolean.valueOf(properties.getProperty(
                 "cache.total.results.enabled","true"));
+
+        maxTokenContext = Integer.parseInt(properties.getProperty(
+                "max.token.context.size", "0"));
     }
 
     @Deprecated
diff --git a/src/main/java/de/ids_mannheim/korap/rewrite/CollectionRewrite.java b/src/main/java/de/ids_mannheim/korap/rewrite/CollectionRewrite.java
index 0c3ee07..56b0092 100644
--- a/src/main/java/de/ids_mannheim/korap/rewrite/CollectionRewrite.java
+++ b/src/main/java/de/ids_mannheim/korap/rewrite/CollectionRewrite.java
@@ -150,7 +150,7 @@
 
         KoralCollectionQueryBuilder builder = new KoralCollectionQueryBuilder();
         RewriteIdentifier identifier = new KoralNode.RewriteIdentifier(
-                Attributes.AVAILABILITY, user.getCorpusAccess());
+                Attributes.AVAILABILITY, user.getCorpusAccess().name());
         JsonNode rewrittenNode;
 
         if (jsonNode.has("collection")) {
diff --git a/src/main/java/de/ids_mannheim/korap/rewrite/KoralNode.java b/src/main/java/de/ids_mannheim/korap/rewrite/KoralNode.java
index f05f864..0893820 100644
--- a/src/main/java/de/ids_mannheim/korap/rewrite/KoralNode.java
+++ b/src/main/java/de/ids_mannheim/korap/rewrite/KoralNode.java
@@ -92,22 +92,23 @@
             else if (value instanceof JsonNode)
                 n.put(name, (JsonNode) value);
 
-            if (ident != null)
-                name = ident.toString();
+//            if (ident != null)
+//                name = ident.toString();
 
-            this.rewrites.add("override", name);
+            this.rewrites.add("override", null, ident);
         }
     }
 
     public void replaceAt (String path, Object value, RewriteIdentifier ident) {
-        if (this.node.isObject() && !this.node.at(path).isMissingNode()) {
+        if (this.node.isObject() && 
+                !this.node.at(path).isMissingNode()) {
             ObjectNode n = (ObjectNode) this.node.at(path);
             n.removeAll();
             n.putAll((ObjectNode) value);
 
             String name = path;
             if (ident != null)
-                name = ident.toString();
+                name = ident.toString(); // scope is simply RewriteIdentifier ?? 
 
             this.rewrites.add("override", name);
         }
@@ -169,16 +170,31 @@
 
     public static class RewriteIdentifier {
 
-        private String key, value;
+        private String scope, value;
+        private Object source;
 
-        public RewriteIdentifier (String key, Object value) {
-            this.key = key;
-            this.value = value.toString();
+        public RewriteIdentifier (String scope, String value) {
+            this.scope = scope;
+            this.value = value;
         }
-
+        
+        public RewriteIdentifier (String scope, String value, Object source) {
+            this.scope = scope;
+            this.value = value;
+            this.source = source;
+        }
+        
+        public String getScope () {
+            return scope;
+        }
+        
+        public Object getSource () {
+            return source;
+        }
+        
         @Override
         public String toString () {
-            return key + "(" + value + ")";
+            return scope + "(" + value + ")";
         }
 
     }
@@ -204,6 +220,19 @@
             this.rewrites.add(rewrite);
             return this;
         }
+        
+        public KoralRewriteBuilder add (String op, String scope, RewriteIdentifier ri) {
+            KoralRewrite rewrite = new KoralRewrite();
+            rewrite.setOperation(op);
+            if (ri.getScope() != null) {
+                rewrite.setScope(ri.getScope());
+            }
+            if (ri.getSource() != null) {
+                rewrite.setSource(ri.getSource());
+            }
+            this.rewrites.add(rewrite);
+            return this;
+        }
 
         public JsonNode build (JsonNode node) {
             for (KoralRewrite rewrite : this.rewrites) {
@@ -234,24 +263,27 @@
 
     private static class KoralRewrite {
 
-        private Map<String, String> map;
+        private Map<String, Object> map;
 
         private KoralRewrite () {
             this.map = new LinkedHashMap<>();
             this.map.put("@type", "koral:rewrite");
             this.map.put("src", "Kustvakt");
+            this.map.put("origin", "Kustvakt");
         }
 
-        public KoralRewrite setOperation (String op) {
+        public void setOperation (String op) {
             if (!op.startsWith("operation:"))
                 op = "operation:" + op;
             this.map.put("operation", op);
-            return this;
         }
 
-        public KoralRewrite setScope (String scope) {
+        public void setScope (String scope) {
             this.map.put("scope", scope);
-            return this;
+        }
+        
+        public void setSource(Object source) {
+            this.map.put("source", source);
         }
 
     }
@@ -269,4 +301,11 @@
         return this.wrapNode(this.node.get(i));
     }
 
+    public int asInt() {
+        return this.node.asInt();
+    }
+    
+    public String asText(){
+        return this.node.asText();
+    }
 }
diff --git a/src/main/java/de/ids_mannheim/korap/rewrite/QueryContextRewrite.java b/src/main/java/de/ids_mannheim/korap/rewrite/QueryContextRewrite.java
new file mode 100644
index 0000000..1f75e21
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/rewrite/QueryContextRewrite.java
@@ -0,0 +1,55 @@
+package de.ids_mannheim.korap.rewrite;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+
+import de.ids_mannheim.korap.config.KustvaktConfiguration;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.rewrite.KoralNode.RewriteIdentifier;
+import de.ids_mannheim.korap.user.User;
+import de.ids_mannheim.korap.utils.JsonUtils;
+
+@Component
+public class QueryContextRewrite implements RewriteTask.RewriteQuery {
+
+    @Autowired
+    private KustvaktConfiguration config;
+
+    @Override
+    public KoralNode rewriteQuery (KoralNode node, KustvaktConfiguration config,
+            User user) throws KustvaktException {
+        
+        if (config.getMaxTokenContext() > 0) {
+            boolean isContextCut = false;
+            KoralNode context = node.at("/meta/context");
+            isContextCut = cutContext(context, "left");
+            isContextCut = cutContext(context, "right") || isContextCut;
+            if (isContextCut) context.buildRewrites();
+        }
+        return node;
+    }
+    
+    private boolean cutContext (KoralNode context, String position) 
+            throws KustvaktException {
+        KoralNode contextPosition = context.at("/" + position);
+        String type = contextPosition.at("/0").asText();
+
+        if (type.equals("token")) {
+            int length = contextPosition.at("/1").asInt();
+            int maxContextLength = config.getMaxTokenContext();
+            if (length > maxContextLength) {
+                JsonNode sourceNode = JsonUtils
+                        .readTree(contextPosition.toString());
+                ArrayNode arrayNode = (ArrayNode) contextPosition.rawNode();
+                arrayNode.set(1, maxContextLength);
+                context.replace(position, arrayNode, new RewriteIdentifier(
+                        position, null, sourceNode));
+                return true;
+            }
+        }
+        return false;
+    }
+}
\ No newline at end of file
diff --git a/src/test/java/de/ids_mannheim/korap/cache/TotalResultTest.java b/src/test/java/de/ids_mannheim/korap/cache/TotalResultTest.java
index 7886ddc..31f8e6d 100644
--- a/src/test/java/de/ids_mannheim/korap/cache/TotalResultTest.java
+++ b/src/test/java/de/ids_mannheim/korap/cache/TotalResultTest.java
@@ -164,9 +164,9 @@
         ObjectNode queryNode = (ObjectNode) JsonUtils.readTree(entity);
         queryNode.remove("meta");
         queryNode.remove("matches");
-        int queryHashCode1 = queryNode.hashCode();
+//        int queryHashCode1 = queryNode.hashCode();
         int queryStringHashCode1 = queryNode.toString().hashCode();
-        
+
         response = target().path(API_VERSION).path("search")
                 .queryParam("q", "[orth=populistisches]")
                 .queryParam("ql", "poliqarp")
@@ -183,10 +183,10 @@
         queryNode = (ObjectNode) JsonUtils.readTree(entity);
         queryNode.remove("meta");
         queryNode.remove("matches");
-        int queryHashCode2 = queryNode.hashCode();
+//        int queryHashCode2 = queryNode.hashCode();
         int queryStringHashCode2 = queryNode.toString().hashCode();
         
-        assertEquals(queryHashCode1, queryHashCode2);
+//        assertEquals(queryHashCode1, queryHashCode2);
         assertNotEquals(queryStringHashCode1, queryStringHashCode2);
     }
 }
diff --git a/src/test/java/de/ids_mannheim/korap/misc/KoralNodeTest.java b/src/test/java/de/ids_mannheim/korap/misc/KoralNodeTest.java
index eb9051b..7f923d6 100644
--- a/src/test/java/de/ids_mannheim/korap/misc/KoralNodeTest.java
+++ b/src/test/java/de/ids_mannheim/korap/misc/KoralNodeTest.java
@@ -5,6 +5,7 @@
 import org.junit.jupiter.api.Test;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import de.ids_mannheim.korap.rewrite.KoralNode;
+import de.ids_mannheim.korap.rewrite.KoralNode.RewriteIdentifier;
 import de.ids_mannheim.korap.utils.JsonUtils;
 
 /**
@@ -37,7 +38,8 @@
         ObjectNode node = JsonUtils.createObjectNode();
         node.put("value_1", "setting_1");
         KoralNode knode = KoralNode.wrapNode(node);
-        knode.replace("value_1", "settings_2", null);
+        knode.replace("value_1", "settings_2",
+                new RewriteIdentifier("value_1", "setting_1"));
         assertEquals(knode.rawNode().toString(),
                 "{\"value_1\":\"settings_2\"}");
     }
diff --git a/src/test/java/de/ids_mannheim/korap/rewrite/QueryContextRewriteTest.java b/src/test/java/de/ids_mannheim/korap/rewrite/QueryContextRewriteTest.java
new file mode 100644
index 0000000..3ee6feb
--- /dev/null
+++ b/src/test/java/de/ids_mannheim/korap/rewrite/QueryContextRewriteTest.java
@@ -0,0 +1,83 @@
+package de.ids_mannheim.korap.rewrite;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+import de.ids_mannheim.korap.config.KustvaktConfiguration;
+import de.ids_mannheim.korap.config.SpringJerseyTest;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.query.serialize.MetaQueryBuilder;
+import de.ids_mannheim.korap.query.serialize.QuerySerializer;
+import de.ids_mannheim.korap.user.KorAPUser;
+import de.ids_mannheim.korap.utils.JsonUtils;
+import jakarta.ws.rs.core.Response;
+
+public class QueryContextRewriteTest extends SpringJerseyTest {
+    
+    @Autowired
+    public RewriteHandler handler;
+    
+    @Autowired
+    private KustvaktConfiguration config;
+
+    @Test
+    public void testCutTokenContext () throws KustvaktException, Exception {
+        Response response = target().path(API_VERSION).path("search")
+                .queryParam("q", "Sonne")
+                .queryParam("ql", "poliqarp")
+                .queryParam("context", "60-token,60-token")
+                .request()
+                .get();
+        String ent = response.readEntity(String.class);
+        JsonNode node = JsonUtils.readTree(ent);
+        
+        JsonNode context = node.at("/meta/context");
+        assertEquals(config.getMaxTokenContext(), context.at("/left/1").asInt());
+        assertEquals(config.getMaxTokenContext(), context.at("/right/1").asInt());
+        
+        // match context
+        context = node.at("/matches/0/context");
+        assertEquals(config.getMaxTokenContext(), context.at("/left/1").asInt());
+        assertEquals(config.getMaxTokenContext(), context.at("/right/1").asInt());
+    }
+
+    @Test
+    public void testMetaRewrite () throws KustvaktException {
+        QuerySerializer s = new QuerySerializer();
+        s.setQuery("Schnee within s", "poliqarp");
+        
+        MetaQueryBuilder meta = new MetaQueryBuilder();
+        meta.setSpanContext("60-token,60-token");
+        s.setMeta(meta.raw());
+        
+        String jsonQuery = s.toJSON();
+        JsonNode queryNode = JsonUtils.readTree(jsonQuery);
+        
+        JsonNode context = queryNode.at("/meta/context");
+        assertEquals(60, context.at("/left/1").asInt());
+        assertEquals(60, context.at("/right/1").asInt());
+        
+        String result = handler.processQuery(s.toJSON(), new KorAPUser("test"));
+        JsonNode node = JsonUtils.readTree(result);
+        
+        context = node.at("/meta/context");
+        assertEquals(40, context.at("/left/1").asInt());
+        assertEquals(40, context.at("/right/1").asInt());
+        
+        assertEquals("koral:rewrite", context.at("/rewrites/0/@type").asText());
+        assertEquals("Kustvakt", context.at("/rewrites/0/origin").asText());
+        assertEquals("operation:override", context.at("/rewrites/0/operation").asText());
+        assertEquals("left", context.at("/rewrites/0/scope").asText());
+        assertEquals("token", context.at("/rewrites/0/source/0").asText());
+        assertEquals(60, context.at("/rewrites/0/source/1").asInt());
+        
+        assertEquals("right", context.at("/rewrites/1/scope").asText());
+        assertEquals("token", context.at("/rewrites/1/source/0").asText());
+        assertEquals(60, context.at("/rewrites/1/source/1").asInt());
+        
+    }
+}
diff --git a/src/test/resources/kustvakt-test.conf b/src/test/resources/kustvakt-test.conf
index 7818711..ddc8512 100644
--- a/src/test/resources/kustvakt-test.conf
+++ b/src/test/resources/kustvakt-test.conf
@@ -49,6 +49,7 @@
 
 # Virtual corpus and queries
 max.user.persistent.queries = 5
+max.token.context.size = 40
 
 # Availability regex only support |
 # It should be removed/commented when the data doesn't contain availability field.
diff --git a/src/test/resources/test-config.xml b/src/test/resources/test-config.xml
index 5811a33..1f8beba 100644
--- a/src/test/resources/test-config.xml
+++ b/src/test/resources/test-config.xml
@@ -196,6 +196,9 @@
 		class="de.ids_mannheim.korap.rewrite.VirtualCorpusRewrite" />
 	<bean id="queryReferenceRewrite"
 		class="de.ids_mannheim.korap.rewrite.QueryReferenceRewrite" />
+	<bean id="queryContextRewrite"
+		class="de.ids_mannheim.korap.rewrite.QueryContextRewrite" />
+		
 
 	<util:list id="rewriteTasks"
 		value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
@@ -203,6 +206,7 @@
 		<ref bean="collectionRewrite" />
 		<ref bean="virtualCorpusRewrite" />
 		<ref bean="queryReferenceRewrite" />
+		<ref bean="queryContextRewrite" />
 	</util:list>
 
 	<bean id="rewriteHandler"
