diff --git a/src/main/antlr/CollectionQuery.g4 b/src/main/antlr/CollectionQuery.g4
index d3b25b4..f46bbbf 100644
--- a/src/main/antlr/CollectionQuery.g4
+++ b/src/main/antlr/CollectionQuery.g4
@@ -38,13 +38,18 @@
 COLON				: ':';
 DASH				: '-';
 TILDE				: '~';
+SINCE				: 'since';
+UNTIL				: 'until';
+IN					: 'in';
+ON					: 'on';
 WS 					: ( ' ' | '\t' | '\r' | '\n' )+ -> skip ;
 fragment NO_RE      : ~[ \t\/];
 fragment ALPHABET   : ~('\t' | ' ' | '/' | '*' | '?' | '+' | '{' | '}' | '[' | ']'
                     | '(' | ')' | '|' | '"' | ',' | ':' | '\'' | '\\' | '!' | '=' | '~' | '&' | '^' | '<' | '>' );
 fragment ALPHA		: [a-zA-Z];
-DIGIT				: [0-9];
 
+
+DIGIT		: [0-9];
 DATE
 : DIGIT DIGIT DIGIT DIGIT (DASH DIGIT DIGIT (DASH DIGIT DIGIT)?)?
 ;
@@ -52,7 +57,9 @@
 NL                  : [\r\n] -> skip;
 ws                  : WS+;
 
-WORD                : ALPHABET* ALPHA ALPHABET*;  // needs to have at least one alphabetical letter (non-numeric)
+WORD				: ALPHABET+;
+//WORD                : ALPHABET* ALPHA ALPHABET*;  // needs to have at least one alphabetical letter (non-numeric)
+
 
 /*
  * Regular expressions
@@ -82,16 +89,29 @@
 : DATE
 ;
 
+dateOp
+: SINCE
+| UNTIL
+| IN
+| ON
+;
+
 operator
 :	(NEG? EQ) | LT | GT | LEQ | GEQ | TILDE;
 
 expr
-: meta
+: constraint
+| dateconstraint
 | token
 ;
 
-meta
-: (value operator)? field operator value
+dateconstraint
+: field dateOp date
+//| date dateOp field dateOp date
+;
+
+constraint
+: field operator value
 ;
 
 token
@@ -139,8 +159,9 @@
 	
 value
 : WORD
+| DIGIT+
+| DATE
 | multiword
-| date
 | regex
 ;
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryTree.java b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryTree.java
index 46d4b3f..82f3a80 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryTree.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQueryTree.java
@@ -3,6 +3,7 @@
 import de.ids_mannheim.korap.query.serialize.util.CollectionQueryLexer;
 import de.ids_mannheim.korap.query.serialize.util.CollectionQueryParser;
 import de.ids_mannheim.korap.util.QueryException;
+
 import org.antlr.v4.runtime.*;
 import org.antlr.v4.runtime.tree.*;
 
@@ -16,18 +17,9 @@
 public class CollectionQueryTree extends Antlr4AbstractSyntaxTree {
 
     private Parser parser;
-    private boolean verbose;
+    private static boolean verbose;
     private List<ParseTree> visited = new ArrayList<ParseTree>();
 
-
-    public CollectionQueryTree() {
-        verbose = false;
-    }
-
-    public CollectionQueryTree(boolean verbose) {
-        this.verbose = verbose;
-    }
-
     /**
      * Keeps track of active object.
      */
@@ -42,6 +34,13 @@
     LinkedList<Integer> objectsToPop = new LinkedList<Integer>();
     Integer stackedObjects = 0;
     
+    public CollectionQueryTree() {
+	}
+    
+    public CollectionQueryTree(boolean verbose) {
+    	CollectionQueryTree.verbose = verbose;
+	}
+    
     public CollectionQueryTree(String query) throws QueryException {
 		process(query);
 	}
@@ -64,9 +63,7 @@
         String nodeCat = getNodeCat(node);
         openNodeCats.push(nodeCat);
 
-
         stackedObjects = 0;
-
         if (verbose) {
             System.err.println(" " + objectStack);
             System.out.println(openNodeCats);
@@ -88,59 +85,39 @@
             stackedObjects++;
         }
 
-//        if (nodeCat.equals("orGroup")) {
-//            LinkedHashMap<String, Object> exprGroup = makeDocGroup("or");
-//            putIntoSuperObject(exprGroup);
-//            objectStack.push(exprGroup);
-//            stackedObjects++;
-//        }
-
-        if (nodeCat.equals("meta")) {
+        if (nodeCat.equals("constraint")) {
             ParseTree fieldNode = getFirstChildWithCat(node, "field");
             String field = fieldNode.getChild(0).toStringTree(parser);
-            List<ParseTree> operatorNodes = getChildrenWithCat(node, "operator");
-            List<ParseTree> valueNodes = getChildrenWithCat(node, "value");
-
-            if (valueNodes.size() == 1) {
-                LinkedHashMap<String, Object> term = makeDoc();
-                term.put("key", field);
-                term.putAll(parseValue(valueNodes.get(0)));
-                String match = operatorNodes.get(0).getText();
-                term.put("match", "match:" + interpretMatch(match));
-                if (checkOperatorValueConformance(term) == 1) {
-                	requestMap.put("collection", new LinkedHashMap<String,Object>());
-                	return;
-                }
-                putIntoSuperObject(term);
-            } else { // (valueNodes.size()==2)
-                LinkedHashMap<String, Object> termGroup = makeDocGroup("and");
-                ArrayList<Object> termGroupOperands = (ArrayList<Object>) termGroup.get("operands");
-
-                LinkedHashMap<String, Object> term1 = makeDoc();
-                term1.put("key", field);
-                term1.putAll(parseValue(valueNodes.get(0)));
-                String match1 = operatorNodes.get(0).getText();
-                term1.put("match", "match:" + invertInequation(interpretMatch(match1)));
-                termGroupOperands.add(term1);
-                if (checkOperatorValueConformance(term1) == 1) {
-                	requestMap.put("collection", new LinkedHashMap<String,Object>());
-                	return;
-                }
-
-                LinkedHashMap<String, Object> term2 = makeDoc();
-                term2.put("key", field);
-                term2.putAll(parseValue(valueNodes.get(1)));
-                String match2 = operatorNodes.get(1).getText();
-                term2.put("match", "match:" + interpretMatch(match2));
-                termGroupOperands.add(term2);
-                if (checkOperatorValueConformance(term2) == 1) {
-                	requestMap.put("collection", new LinkedHashMap<String,Object>());
-                	return;
-                }
-
-                putIntoSuperObject(termGroup);
+            ParseTree operatorNode = getFirstChildWithCat(node, "operator");
+            ParseTree valueNode = getFirstChildWithCat(node, "value");
+            LinkedHashMap<String, Object> term = makeDoc();
+            term.put("key", field);
+            term.putAll(parseValue(valueNode));
+            String match = operatorNode.getText();
+            term.put("match", "match:" + interpretMatchOperator(match));
+            if (checkOperatorValueConformance(term) == false) {
+            	requestMap = new LinkedHashMap<String,Object>();
+            	return;
             }
+            putIntoSuperObject(term);
+        }
+        
+        if (nodeCat.equals("dateconstraint")) {
+            ParseTree fieldNode = getFirstChildWithCat(node, "field");
+            String field = fieldNode.getChild(0).toStringTree(parser);
+            ParseTree dateOpNode = getFirstChildWithCat(node, "dateOp");
+            ParseTree dateNode = getFirstChildWithCat(node, "date");
 
+            LinkedHashMap<String, Object> term = makeDoc();
+            term.put("key", field);
+            term.putAll(parseValue(dateNode));
+            String match = dateOpNode.getText();
+            term.put("match", "match:" + interpretMatchOperator(match));
+            if (checkOperatorValueConformance(term) == false) {
+            	requestMap = new LinkedHashMap<String,Object>();
+            	return;
+            }
+            putIntoSuperObject(term);
         }
         
         if (nodeCat.equals("token")) {
@@ -153,7 +130,6 @@
 			if (getNodeCat(node.getChild(0)).equals("key")) {
 				// no 'term' child, but direct key specification: process here
 				LinkedHashMap<String,Object> term = makeTerm();
-				
 				String key = node.getChild(0).getText();
 				if (getNodeCat(node.getChild(0).getChild(0)).equals("regex")) {
 					isRegex = true;
@@ -187,7 +163,7 @@
 			visited.add(node.getChild(0));
 			visited.add(node.getChild(2));
 		}
-        
+
         objectsToPop.push(stackedObjects);
 
 		/*
@@ -218,43 +194,48 @@
 
     }
 
-
-    private int checkOperatorValueConformance(LinkedHashMap<String, Object> term) {
+	/**
+	 * Checks whether the combination of operator and value is legal (inequation operators <,>,<=,>= may only be used with dates).
+	 */
+    private boolean checkOperatorValueConformance(LinkedHashMap<String, Object> term) {
 		String match = (String) term.get("match");
 		String type = (String) term.get("type");
 		if (type == null || type.equals("type:regex")) {
 			if (!(match.equals("match:eq") || match.equals("match:ne") || match.equals("match:contains"))) {
 				addError(302, "You used an inequation operator with a string value.");
-				System.err.println("You used an inequation operator with a string value.");
-				return 1;
+				return false;
 			}
 		}
-		return 0;
+		return true;
 	}
 
 	private LinkedHashMap<String, Object> parseValue(ParseTree valueNode) {
     	LinkedHashMap<String, Object> map = new LinkedHashMap<String, Object>();
+    	if (getNodeCat(valueNode).equals("date")) {
+    		map.put("type", "type:date");
+    		checkDateValidity(valueNode);
+    	}
     	if (getNodeCat(valueNode.getChild(0)).equals("regex")) {
     		String regex = valueNode.getChild(0).getChild(0).toStringTree(parser);
     		map.put("value", regex.substring(1, regex.length()-1));
     		map.put("type", "type:regex");
     	} else if (getNodeCat(valueNode.getChild(0)).equals("multiword")) {
-    		String mw = "";
+    		String mw = ""; // multiword
     		for (int i=1; i<valueNode.getChild(0).getChildCount()-1; i++) {
     			mw += valueNode.getChild(0).getChild(i).getText() + " ";
     		}
     		map.put("value", mw.substring(0, mw.length()-1));
-    	} else if (getNodeCat(valueNode.getChild(0)).equals("date")) {
-    		map.put("type", "type:date");
-    		String value = valueNode.getChild(0).getChild(0).toStringTree(parser);
-    		map.put("value", value);
     	} else {
     		map.put("value", valueNode.getChild(0).toStringTree(parser));
     	}
 		return map;
 	}
 
-	private String interpretMatch(String match) {
+	private void checkDateValidity(ParseTree valueNode) {
+		// TODO ensure month is <= 12, day is <= 31 etc.
+	}
+
+	private String interpretMatchOperator(String match) {
         String out = null;
         switch (match) {
             case "<":
@@ -278,11 +259,30 @@
             case "~":
                 out = "contains";
                 break;    
-               
+            case "!~":
+                out = "notcontains";
+                break;    
+            case "in":
+                out = "eq";
+                break;
+            case "on":
+                out = "eq";
+                break;
+            case "until":
+                out = "leq";
+                break;    
+            case "since":
+                out = "geq";
+                break;
+            default:
+            	out = match;
+            	addError(302, "Unknown operator '"+match+"'.");
+            	break;
         }
         return out;
     }
-
+	
+	@Deprecated
     private String invertInequation(String op) {
         String inv = null;
         switch (op) {
@@ -312,9 +312,8 @@
             ArrayList<Object> topObjectOperands = (ArrayList<Object>) objectStack.get(objStackPosition).get("operands");
             topObjectOperands.add(object);
         } else {
-            // I want the raw object, not a wrapped
-//            requestMap.put("filter", object);
-        	requestMap.put("collection", object);
+        	requestMap = object;
+//        	requestMap.put("collection", object);
         }
     }
 
@@ -449,11 +448,13 @@
         query = "(textClass=wissenschaft & textClass=politik) | textClass=ausland";
         query = "1990<year<2010 & genre=Sport";
         query = "1990<year<2010";
-        query = "pubDate<Sport";
-//    	filter.verbose = true;
+        query = "textClass=Sport & year=2014";
+        query = "textClass=0154";
+        CollectionQueryTree.verbose = true;
         CollectionQueryTree filter = null;
         try {
         	 filter = new CollectionQueryTree(query);
+        	 filter.verbose = true;
         } catch (QueryException e) {
             e.printStackTrace();
         }
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/QuerySerializer.java b/src/main/java/de/ids_mannheim/korap/query/serialize/QuerySerializer.java
index f0ae995..f124a00 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/QuerySerializer.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/QuerySerializer.java
@@ -27,45 +27,45 @@
             .getLogger(QuerySerializer.class);
 
 
-    /**
-     * @param args
-     * @throws QueryException
-     */
-    public static void main(String[] args) {
-        /*
-         * just for testing...
-		 */
-        QuerySerializer jg = new QuerySerializer();
-        int i = 0;
-        String[] queries;
-        if (args.length == 0) {
-            queries = new String[]{
-
-            };
-        } else
-            queries = new String[]{args[0]};
-
-        for (String q : queries) {
-            i++;
-            try {
-                System.out.println(q);
-                String ql = "cosmas2";
-                jg.run(q, ql, System.getProperty("user.home") + "/" + ql + "_" + i + ".jsonld");
-                System.out.println();
-            } catch (NullPointerException npe) {
-                npe.printStackTrace();
-                System.out.println("null\n");
-            } catch (JsonGenerationException e) {
-                e.printStackTrace();
-            } catch (JsonMappingException e) {
-                e.printStackTrace();
-            } catch (IOException e) {
-                e.printStackTrace();
-            } catch (QueryException e) {
-                e.printStackTrace();
-            }
-        }
-    }
+//    /**
+//     * @param args
+//     * @throws QueryException
+//     */
+//    public static void main(String[] args) {
+//        /*
+//         * just for testing...
+//		 */
+//        QuerySerializer jg = new QuerySerializer();
+//        int i = 0;
+//        String[] queries;
+//        if (args.length == 0) {
+//            queries = new String[]{
+//
+//            };
+//        } else
+//            queries = new String[]{args[0]};
+//
+//        for (String q : queries) {
+//            i++;
+//            try {
+//                System.out.println(q);
+//                String ql = "cosmas2";
+//                jg.run(q, ql, System.getProperty("user.home") + "/" + ql + "_" + i + ".jsonld");
+//                System.out.println();
+//            } catch (NullPointerException npe) {
+//                npe.printStackTrace();
+//                System.out.println("null\n");
+//            } catch (JsonGenerationException e) {
+//                e.printStackTrace();
+//            } catch (JsonMappingException e) {
+//                e.printStackTrace();
+//            } catch (IOException e) {
+//                e.printStackTrace();
+//            } catch (QueryException e) {
+//                e.printStackTrace();
+//            }
+//        }
+//    }
 
     /**
      * Runs the QuerySerializer by initializing the relevant AbstractSyntaxTree implementation (depending on specified query language)
@@ -77,24 +77,24 @@
      * @throws IOException
      * @throws QueryException
      */
-    public void run(String query, String queryLanguage, String outFile)
-            throws IOException, QueryException {
-        if (queryLanguage.equals("poliqarp")) {
-            ast = new PoliqarpPlusTree(query);
-        } else if (queryLanguage.toLowerCase().equals("cosmas2")) {
-            ast = new CosmasTree(query);
-        } else if (queryLanguage.toLowerCase().equals("poliqarpplus")) {
-            ast = new PoliqarpPlusTree(query);
-        } else if (queryLanguage.toLowerCase().equals("cql")) {
-            ast = new CQLTree(query);
-        } else if (queryLanguage.toLowerCase().equals("annis")) {
-            ast = new AqlTree(query);
-        } else {
-            throw new QueryException(queryLanguage + " is not a supported query language!");
-        }
-        Map<String, Object> requestMap = ast.getRequestMap();
-//        mapper.writeValue(new File(outFile), requestMap);
-    }
+//    public void run(String query, String queryLanguage, String outFile)
+//            throws IOException, QueryException {
+//        if (queryLanguage.equals("poliqarp")) {
+//            ast = new PoliqarpPlusTree(query);
+//        } else if (queryLanguage.toLowerCase().equals("cosmas2")) {
+//            ast = new CosmasTree(query);
+//        } else if (queryLanguage.toLowerCase().equals("poliqarpplus")) {
+//            ast = new PoliqarpPlusTree(query);
+//        } else if (queryLanguage.toLowerCase().equals("cql")) {
+//            ast = new CQLTree(query);
+//        } else if (queryLanguage.toLowerCase().equals("annis")) {
+//            ast = new AqlTree(query);
+//        } else {
+//            throw new QueryException(queryLanguage + " is not a supported query language!");
+//        }
+//        Map<String, Object> requestMap = ast.getRequestMap();
+////        mapper.writeValue(new File(outFile), requestMap);
+//    }
 
     public QuerySerializer setQuery(String query, String ql, String version)
             throws QueryException {
@@ -147,7 +147,7 @@
             Map<String, Object> requestMap = ast.getRequestMap();
             Map meta = (Map) requestMap.get("meta");
             if (collection != null)
-                requestMap.put("collections", collection);
+                requestMap.put("collection", collection);
             if (this.meta != null) {
                 meta.putAll(this.meta);
                 requestMap.put("meta", meta);
diff --git a/src/test/java/CollectionQueryTreeTest.java b/src/test/java/CollectionQueryTreeTest.java
index ebe9cc7..acf09d7 100644
--- a/src/test/java/CollectionQueryTreeTest.java
+++ b/src/test/java/CollectionQueryTreeTest.java
@@ -1,301 +1,378 @@
 import static org.junit.Assert.*;
-import de.ids_mannheim.korap.query.serialize.CollectionQueryTree;
+
+import java.io.IOException;
+import java.util.ArrayList;
+
+import de.ids_mannheim.korap.query.serialize.QuerySerializer;
 import de.ids_mannheim.korap.util.QueryException;
+
 import org.junit.Test;
 
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
 public class CollectionQueryTreeTest {
 
-	CollectionQueryTree cqt;
-	String map;
-	private String query;
-	private String expected;
+	String query = "foo";
+	String ql = "poliqarpplus";
+	String collection;
+	ArrayList<JsonNode> operands;
 
+	QuerySerializer qs = new QuerySerializer();
+	ObjectMapper mapper = new ObjectMapper();
+	JsonNode res;
+	
 	@Test
-	public void testSimple() throws QueryException {
-		query = "textClass=Sport";
-		//      String regex1 = "{@type=korap:filter, filter={@type=korap:doc, attribute=textClass, key=Sport, match=match:eq}}";
-		expected = "{@type=korap:doc, key=textClass, value=Sport, match=match:eq}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-
-		query = "textClass!=Sport";
-		//	      String regex1 = "{@type=korap:filter, filter={@type=korap:doc, attribute=textClass, key=Sport, match=match:eq}}";
-		expected = "{@type=korap:doc, key=textClass, value=Sport, match=match:ne}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+	public void testContext() throws QueryException, JsonProcessingException, IOException {
+		collection = "textClass=politik";
+		String contextString = "http://ids-mannheim.de/ns/KorAP/json-ld/v0.2/context.jsonld";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals(contextString, res.get("@context").asText());
 	}
 	
 	@Test
-	public void testContains() throws QueryException {
-		query = "title~Mannheim";
-		expected = 
-			"{@type=korap:doc, key=title, value=Mannheim, match=match:contains}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+	public void testSimple() throws QueryException, JsonProcessingException, IOException {
+		collection = "textClass=politik";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:doc", 		res.at("/collection/@type").asText());
+		assertEquals("textClass", 		res.at("/collection/key").asText());
+		assertEquals("politik", 		res.at("/collection/value").asText());
+		assertEquals("match:eq", 		res.at("/collection/match").asText());
 		
-		query = "title~\"IDS Mannheim\"";
-		expected = 
-			"{@type=korap:doc, key=title, value=IDS Mannheim, match=match:contains}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		collection = "textClass!=politik";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:doc", 		res.at("/collection/@type").asText());
+		assertEquals("textClass", 		res.at("/collection/key").asText());
+		assertEquals("politik", 		res.at("/collection/value").asText());
+		assertEquals("match:ne", 		res.at("/collection/match").asText());
 	}
 	
 	@Test
-	public void testTwoConjuncts() throws QueryException {
-		query = "textClass=Sport & year=2014";
-		expected = 
-				"{@type=korap:docGroup, operation=operation:and, operands=[" +
-					"{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," +
-					"{@type=korap:doc, key=year, type=type:date, value=2014, match=match:eq}" +
-				"]}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-	}
-
-    //todo year type is not yet serialized!
-	@Test
-	public void testThreeConjuncts() throws QueryException {
-		query = "textClass=Sport & year=2014 & corpusID=WPD";
-		expected = 
-				"{@type=korap:docGroup, operation=operation:and, operands=[" +
-					"{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," +
-					"{@type=korap:docGroup, operation=operation:and, operands=[" +
-						"{@type=korap:doc, key=year, type=type:date, value=2014, match=match:eq}," +
-						"{@type=korap:doc, key=corpusID, value=WPD, match=match:eq}" +
-					"]}" +
-				"]}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-	}
-	
-
-	@Test
-	public void testTwoDisjuncts() throws QueryException {
-		query = "textClass=Sport | year=2014";
-		expected = 
-				"{@type=korap:docGroup, operation=operation:or, operands=[" +
-					"{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," +
-					"{@type=korap:doc, key=year, type=type:date, value=2014, match=match:eq}" +
-				"]}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+	public void testContains() throws QueryException, JsonProcessingException, IOException {
+		collection = "title~Mannheim";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:doc", 		res.at("/collection/@type").asText());
+		assertEquals("title", 			res.at("/collection/key").asText());
+		assertEquals("Mannheim", 		res.at("/collection/value").asText());
+		assertEquals("match:contains",  res.at("/collection/match").asText());
+		
+		collection = "title~\"IDS Mannheim\"";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:doc", 		res.at("/collection/@type").asText());
+		assertEquals("title",	 		res.at("/collection/key").asText());
+		assertEquals("IDS Mannheim",	res.at("/collection/value").asText());
+		assertEquals("match:contains",	res.at("/collection/match").asText());
 	}
 	
 	@Test
-	public void testThreeDisjuncts() throws QueryException {
-		query = "textClass=Sport | year=2014 | corpusID=WPD";
-		expected = 
-				"{@type=korap:docGroup, operation=operation:or, operands=[" +
-					"{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," +
-					"{@type=korap:docGroup, operation=operation:or, operands=[" +
-						"{@type=korap:doc, key=year, type=type:date, value=2014, match=match:eq}," +
-						"{@type=korap:doc, key=corpusID, value=WPD, match=match:eq}" +
-					"]}" +
-				"]}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-	}
-
-
-	@Test
-	public void testMixed() throws QueryException {
-		query = "(textClass=Sport | textClass=ausland) & corpusID=WPD";
-		expected = 
-			
-				"{@type=korap:docGroup, operation=operation:and, operands=[" +
-					"{@type=korap:docGroup, operation=operation:or, operands=[" +
-						"{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," +
-						"{@type=korap:doc, key=textClass, value=ausland, match=match:eq}" +
-					"]}," +
-					"{@type=korap:doc, key=corpusID, value=WPD, match=match:eq}" +
-				"]}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+	public void testTwoConjuncts() throws QueryException, JsonProcessingException, IOException {
+		collection = "textClass=Sport & pubDate in 2014";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:docGroup", 	res.at("/collection/@type").asText());
+		assertEquals("operation:and",	res.at("/collection/operation").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/0/@type").asText());
+		assertEquals("textClass", 		res.at("/collection/operands/0/key").asText());
+		assertEquals("Sport",			res.at("/collection/operands/0/value").asText());
+		assertEquals("match:eq",		res.at("/collection/operands/0/match").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/1/@type").asText());
+		assertEquals("pubDate",	 		res.at("/collection/operands/1/key").asText());
+		assertEquals("2014",			res.at("/collection/operands/1/value").asText());
+		assertEquals("type:date",		res.at("/collection/operands/1/type").asText());
+		assertEquals("match:eq",		res.at("/collection/operands/1/match").asText());
 		
-		query = "(textClass=Sport & textClass=ausland) & corpusID=WPD";
-		expected = 
-			
-				"{@type=korap:docGroup, operation=operation:and, operands=[" +
-					"{@type=korap:docGroup, operation=operation:and, operands=[" +
-						"{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," +
-						"{@type=korap:doc, key=textClass, value=ausland, match=match:eq}" +
-					"]}," +
-					"{@type=korap:doc, key=corpusID, value=WPD, match=match:eq}" +
-				"]}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "(textClass=Sport & textClass=ausland) | (corpusID=WPD & author=White)";
-		expected = 
-			
-				"{@type=korap:docGroup, operation=operation:or, operands=[" +
-					"{@type=korap:docGroup, operation=operation:and, operands=[" +
-						"{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," +
-						"{@type=korap:doc, key=textClass, value=ausland, match=match:eq}" +
-					"]}," +
-					"{@type=korap:docGroup, operation=operation:and, operands=[" +
-						"{@type=korap:doc, key=corpusID, value=WPD, match=match:eq}," +
-						"{@type=korap:doc, key=author, value=White, match=match:eq}" +
-					"]}" +
-				"]}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "(textClass=Sport & textClass=ausland) | (corpusID=WPD & author=White & year=2010)";
-		expected = 
-				"{@type=korap:docGroup, operation=operation:or, operands=[" +
-					"{@type=korap:docGroup, operation=operation:and, operands=[" +
-						"{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," +
-						"{@type=korap:doc, key=textClass, value=ausland, match=match:eq}" +
-					"]}," +
-					"{@type=korap:docGroup, operation=operation:and, operands=[" +
-						"{@type=korap:doc, key=corpusID, value=WPD, match=match:eq}," +
-						"{@type=korap:docGroup, operation=operation:and, operands=[" +
-							"{@type=korap:doc, key=author, value=White, match=match:eq}," +
-							"{@type=korap:doc, key=year, type=type:date, value=2010, match=match:eq}" +
-						"]}" +
-					"]}" +
-				"]}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		collection = "textClass=Sport & pubDate=2014";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:docGroup", 	res.at("/collection/@type").asText());
+		assertEquals("operation:and",	res.at("/collection/operation").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/0/@type").asText());
+		assertEquals("textClass", 		res.at("/collection/operands/0/key").asText());
+		assertEquals("Sport",			res.at("/collection/operands/0/value").asText());
+		assertEquals("match:eq",		res.at("/collection/operands/0/match").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/1/@type").asText());
+		assertEquals("pubDate",	 		res.at("/collection/operands/1/key").asText());
+		assertEquals("2014",			res.at("/collection/operands/1/value").asText());
+		assertEquals(true,				res.at("/collection/operands/1/type").isMissingNode());
+		assertEquals("match:eq",		res.at("/collection/operands/1/match").asText());
 	}
 
 	@Test
-	public void testDate() throws QueryException {
-		// search for pubDate between 1990 and 2010!
-		query = "1990<pubDate<2010";
-		expected = 
-				"{@type=korap:docGroup, operation=operation:and, operands=[" +
-					"{@type=korap:doc, key=pubDate, type=type:date, value=1990, match=match:gt}," +
-					"{@type=korap:doc, key=pubDate, type=type:date, value=2010, match=match:lt}" +
-				"]}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "pubDate>=1990";
-		expected = 
-				"{@type=korap:doc, key=pubDate, type=type:date, value=1990, match=match:geq}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "pubDate>=1990-05";
-		expected = 
-				"{@type=korap:doc, key=pubDate, type=type:date, value=1990-05, match=match:geq}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "pubDate>=1990-05-01";
-		expected = 
-				"{@type=korap:doc, key=pubDate, type=type:date, value=1990-05-01, match=match:geq}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+	public void testThreeConjuncts() throws QueryException, JsonProcessingException, IOException {
+		collection = "textClass=Sport & pubDate in 2014 & corpusId=WPD";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:docGroup", 	res.at("/collection/@type").asText());
+		assertEquals("operation:and",	res.at("/collection/operation").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/0/@type").asText());
+		assertEquals("textClass", 		res.at("/collection/operands/0/key").asText());
+		assertEquals("Sport",			res.at("/collection/operands/0/value").asText());
+		assertEquals("match:eq",		res.at("/collection/operands/0/match").asText());
+		assertEquals("korap:docGroup", 	res.at("/collection/operands/1/@type").asText());
+		assertEquals("operation:and",	res.at("/collection/operands/1/operation").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/1/operands/0/@type").asText());
+		assertEquals("pubDate",	 		res.at("/collection/operands/1/operands/0/key").asText());
+		assertEquals("2014",			res.at("/collection/operands/1/operands/0/value").asText());
+		assertEquals("type:date",		res.at("/collection/operands/1/operands/0/type").asText());
+		assertEquals("match:eq",		res.at("/collection/operands/1/operands/0/match").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/1/operands/1/@type").asText());
+		assertEquals("corpusId", 		res.at("/collection/operands/1/operands/1/key").asText());
+		assertEquals("WPD",				res.at("/collection/operands/1/operands/1/value").asText());
+		assertEquals("match:eq",		res.at("/collection/operands/1/operands/1/match").asText());
 	}
-
 	@Test
-	public void testRegex() throws QueryException {
-		query = "author=/Go.*he/";
-		expected = 
-				"{@type=korap:doc, key=author, value=Go.*he, type=type:regex, match=match:eq}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+	public void testTwoDisjuncts() throws QueryException, JsonProcessingException, IOException {
+		collection = "textClass=Sport | pubDate in 2014";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:docGroup", 	res.at("/collection/@type").asText());
+		assertEquals("operation:or",	res.at("/collection/operation").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/0/@type").asText());
+		assertEquals("textClass", 		res.at("/collection/operands/0/key").asText());
+		assertEquals("Sport",			res.at("/collection/operands/0/value").asText());
+		assertEquals("match:eq",		res.at("/collection/operands/0/match").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/1/@type").asText());
+		assertEquals("pubDate",	 		res.at("/collection/operands/1/key").asText());
+		assertEquals("2014",			res.at("/collection/operands/1/value").asText());
+		assertEquals("type:date",		res.at("/collection/operands/1/type").asText());
+		assertEquals("match:eq",		res.at("/collection/operands/1/match").asText());
 	}
 	
 	@Test
-	public void testContentFilter() throws QueryException {
-		query = "[base=Schwalbe]";
-		expected = 
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Schwalbe, match=match:eq}}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "[cnx/base=Schwalbe]";
-		expected = 
-				"{@type=korap:token, wrap={@type=korap:term, foundry=cnx, layer=lemma, key=Schwalbe, match=match:eq}}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "[base!=Schwalbe]";
-		expected = 
-				"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Schwalbe, match=match:ne}}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
-		
-		query = "[base=Schwalbe] & [orth=Foul]";
-		expected = 
-				"{@type=korap:docGroup, operation=operation:and, operands=[" +
-						"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Schwalbe, match=match:eq}}," +
-						"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Foul, match=match:eq}}" +
-					"]}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+	public void testThreeDisjuncts() throws QueryException, JsonProcessingException, IOException {
+		collection = "textClass=Sport | pubDate in 2014 | corpusId=WPD";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:docGroup", 	res.at("/collection/@type").asText());
+		assertEquals("operation:or",	res.at("/collection/operation").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/0/@type").asText());
+		assertEquals("textClass", 		res.at("/collection/operands/0/key").asText());
+		assertEquals("Sport",			res.at("/collection/operands/0/value").asText());
+		assertEquals("match:eq",		res.at("/collection/operands/0/match").asText());
+		assertEquals("korap:docGroup", 	res.at("/collection/operands/1/@type").asText());
+		assertEquals("operation:or",	res.at("/collection/operands/1/operation").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/1/operands/0/@type").asText());
+		assertEquals("pubDate",	 		res.at("/collection/operands/1/operands/0/key").asText());
+		assertEquals("2014",			res.at("/collection/operands/1/operands/0/value").asText());
+		assertEquals("type:date",		res.at("/collection/operands/1/operands/0/type").asText());
+		assertEquals("match:eq",		res.at("/collection/operands/1/operands/0/match").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/1/operands/1/@type").asText());
+		assertEquals("corpusId", 		res.at("/collection/operands/1/operands/1/key").asText());
+		assertEquals("WPD",				res.at("/collection/operands/1/operands/1/value").asText());
+		assertEquals("match:eq",		res.at("/collection/operands/1/operands/1/match").asText());
 	}
 	
 	@Test
-	public void testContentMetaMixed() throws QueryException {
-		query = "textClass=Sport & [base=Schwalbe]";
-		expected = 
-				"{@type=korap:docGroup, operation=operation:and, operands=[" +
-					"{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Schwalbe, match=match:eq}}" +
-				"]}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+	public void testMixed() throws QueryException, JsonProcessingException, IOException {
+		collection = "textClass=Sport | (pubDate in 2014 & corpusId=WPD)";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:docGroup", 	res.at("/collection/@type").asText());
+		assertEquals("operation:or",	res.at("/collection/operation").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/0/@type").asText());
+		assertEquals("textClass", 		res.at("/collection/operands/0/key").asText());
+		assertEquals("Sport",			res.at("/collection/operands/0/value").asText());
+		assertEquals("match:eq",		res.at("/collection/operands/0/match").asText());
+		assertEquals("korap:docGroup", 	res.at("/collection/operands/1/@type").asText());
+		assertEquals("operation:and",	res.at("/collection/operands/1/operation").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/1/operands/0/@type").asText());
+		assertEquals("pubDate",	 		res.at("/collection/operands/1/operands/0/key").asText());
+		assertEquals("2014",			res.at("/collection/operands/1/operands/0/value").asText());
+		assertEquals("type:date",		res.at("/collection/operands/1/operands/0/type").asText());
+		assertEquals("match:eq",		res.at("/collection/operands/1/operands/0/match").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/1/operands/1/@type").asText());
+		assertEquals("corpusId", 		res.at("/collection/operands/1/operands/1/key").asText());
+		assertEquals("WPD",				res.at("/collection/operands/1/operands/1/value").asText());
+		assertEquals("match:eq",		res.at("/collection/operands/1/operands/1/match").asText());
 		
-		query = "[base=Schwalbe] & textClass=Sport";
-		expected = 
-				"{@type=korap:docGroup, operation=operation:and, operands=[" +
-					"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Schwalbe, match=match:eq}}," +
-					"{@type=korap:doc, key=textClass, value=Sport, match=match:eq}" +
-				"]}";
-		cqt = new CollectionQueryTree();
-		cqt.process(query);
-		map = cqt.getRequestMap().get("collection").toString();
-		assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
+		collection = "textClass=Sport | pubDate in 2014 & corpusId=WPD";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:docGroup", 	res.at("/collection/@type").asText());
+		assertEquals("operation:or",	res.at("/collection/operation").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/0/@type").asText());
+		assertEquals("textClass", 		res.at("/collection/operands/0/key").asText());
+		assertEquals("Sport",			res.at("/collection/operands/0/value").asText());
+		assertEquals("match:eq",		res.at("/collection/operands/0/match").asText());
+		assertEquals("korap:docGroup", 	res.at("/collection/operands/1/@type").asText());
+		assertEquals("operation:and",	res.at("/collection/operands/1/operation").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/1/operands/0/@type").asText());
+		assertEquals("pubDate",	 		res.at("/collection/operands/1/operands/0/key").asText());
+		assertEquals("2014",			res.at("/collection/operands/1/operands/0/value").asText());
+		assertEquals("type:date",		res.at("/collection/operands/1/operands/0/type").asText());
+		assertEquals("match:eq",		res.at("/collection/operands/1/operands/0/match").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/1/operands/1/@type").asText());
+		assertEquals("corpusId", 		res.at("/collection/operands/1/operands/1/key").asText());
+		assertEquals("WPD",				res.at("/collection/operands/1/operands/1/value").asText());
+		assertEquals("match:eq",		res.at("/collection/operands/1/operands/1/match").asText());
+		
+		collection = "(textClass=Sport | pubDate in 2014) & corpusId=WPD";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:docGroup", 	res.at("/collection/@type").asText());
+		assertEquals("operation:and",	res.at("/collection/operation").asText());
+		assertEquals("korap:docGroup",	res.at("/collection/operands/0/@type").asText());
+		assertEquals("operation:or",	res.at("/collection/operands/0/operation").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/0/operands/0/@type").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/0/operands/1/@type").asText());
+		assertEquals("korap:doc",	 	res.at("/collection/operands/1/@type").asText());
+		
+		collection = "(textClass=Sport & pubDate in 2014) & corpusId=WPD";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:docGroup", 	res.at("/collection/@type").asText());
+		assertEquals("operation:and",	res.at("/collection/operation").asText());
+		assertEquals("korap:docGroup",	res.at("/collection/operands/0/@type").asText());
+		assertEquals("operation:and",	res.at("/collection/operands/0/operation").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/0/operands/0/@type").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/0/operands/1/@type").asText());
+		assertEquals("korap:doc",	 	res.at("/collection/operands/1/@type").asText());
+		
+		collection = "(textClass=Sport & textClass=ausland) | (corpusID=WPD & author=White)";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:docGroup", 	res.at("/collection/@type").asText());
+		assertEquals("operation:or",	res.at("/collection/operation").asText());
+		assertEquals("korap:docGroup",	res.at("/collection/operands/0/@type").asText());
+		assertEquals("operation:and",	res.at("/collection/operands/0/operation").asText());
+		assertEquals("korap:docGroup",	res.at("/collection/operands/1/@type").asText());
+		assertEquals("operation:and",	res.at("/collection/operands/1/operation").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/0/operands/0/@type").asText());
+		assertEquals("Sport",	 		res.at("/collection/operands/0/operands/0/value").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/0/operands/1/@type").asText());
+		assertEquals("ausland",	 		res.at("/collection/operands/0/operands/1/value").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/1/operands/0/@type").asText());
+		assertEquals("WPD",		 		res.at("/collection/operands/1/operands/0/value").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/1/operands/1/@type").asText());
+		assertEquals("White",	 		res.at("/collection/operands/1/operands/1/value").asText());
+		
+		collection = "(textClass=Sport & textClass=ausland) | (corpusID=WPD & author=White & pubDate in 2000)";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:docGroup", 	res.at("/collection/@type").asText());
+		assertEquals("operation:or",	res.at("/collection/operation").asText());
+		assertEquals("korap:docGroup",	res.at("/collection/operands/0/@type").asText());
+		assertEquals("operation:and",	res.at("/collection/operands/0/operation").asText());
+		assertEquals("korap:docGroup",	res.at("/collection/operands/1/@type").asText());
+		assertEquals("operation:and",	res.at("/collection/operands/1/operation").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/0/operands/0/@type").asText());
+		assertEquals("Sport",	 		res.at("/collection/operands/0/operands/0/value").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/0/operands/1/@type").asText());
+		assertEquals("ausland",	 		res.at("/collection/operands/0/operands/1/value").asText());
+		assertEquals("korap:doc", 		res.at("/collection/operands/1/operands/0/@type").asText());
+		assertEquals("WPD",		 		res.at("/collection/operands/1/operands/0/value").asText());
+		assertEquals("korap:docGroup",	res.at("/collection/operands/1/operands/1/@type").asText());
+		assertEquals("operation:and",	res.at("/collection/operands/1/operands/1/operation").asText());
+		assertEquals("White",	 		res.at("/collection/operands/1/operands/1/operands/0/value").asText());
+		assertEquals("2000",	 		res.at("/collection/operands/1/operands/1/operands/1/value").asText());
 	}
 
+	@Test
+	public void testDateYear() throws QueryException, JsonProcessingException, IOException {
+		collection = "pubDate in 2000";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:doc", 		res.at("/collection/@type").asText());
+		assertEquals("pubDate", 		res.at("/collection/key").asText());
+		assertEquals("2000",	 		res.at("/collection/value").asText());
+		assertEquals("type:date", 		res.at("/collection/type").asText());
+		assertEquals("match:eq", 		res.at("/collection/match").asText());
+		
+		collection = "pubDate = 2000";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:doc", 		res.at("/collection/@type").asText());
+		assertEquals("pubDate", 		res.at("/collection/key").asText());
+		assertEquals("2000",	 		res.at("/collection/value").asText());
+		assertEquals(true, 				res.at("/collection/type").isMissingNode());
+		assertEquals("match:eq", 		res.at("/collection/match").asText());
+		
+		collection = "pubDate since 2000";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:doc", 		res.at("/collection/@type").asText());
+		assertEquals("pubDate", 		res.at("/collection/key").asText());
+		assertEquals("2000",	 		res.at("/collection/value").asText());
+		assertEquals("type:date", 		res.at("/collection/type").asText());
+		assertEquals("match:geq", 		res.at("/collection/match").asText());
+		
+		collection = "pubDate until 2000";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:doc", 		res.at("/collection/@type").asText());
+		assertEquals("pubDate", 		res.at("/collection/key").asText());
+		assertEquals("2000",	 		res.at("/collection/value").asText());
+		assertEquals("type:date", 		res.at("/collection/type").asText());
+		assertEquals("match:leq", 		res.at("/collection/match").asText());
+	}
+	
+	@Test
+	public void testDateMonthDay() throws QueryException, JsonProcessingException, IOException {
+		collection = "pubDate in 2000-02";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:doc", 		res.at("/collection/@type").asText());
+		assertEquals("pubDate", 		res.at("/collection/key").asText());
+		assertEquals("2000-02",	 		res.at("/collection/value").asText());
+		assertEquals("type:date", 		res.at("/collection/type").asText());
+		assertEquals("match:eq", 		res.at("/collection/match").asText());
+		
+		collection = "pubDate = 2000-12";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:doc", 		res.at("/collection/@type").asText());
+		assertEquals("pubDate", 		res.at("/collection/key").asText());
+		assertEquals("2000-12",	 		res.at("/collection/value").asText());
+		assertEquals(true, 				res.at("/collection/type").isMissingNode());
+		assertEquals("match:eq", 		res.at("/collection/match").asText());
+		
+		collection = "pubDate since 2000-02-01";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:doc", 		res.at("/collection/@type").asText());
+		assertEquals("pubDate", 		res.at("/collection/key").asText());
+		assertEquals("2000-02-01", 		res.at("/collection/value").asText());
+		assertEquals("type:date", 		res.at("/collection/type").asText());
+		assertEquals("match:geq", 		res.at("/collection/match").asText());
+		
+		collection = "pubDate until 2000-01-01";
+		qs.setQuery(query,ql);
+		qs.setCollection(collection);
+		res = mapper.readTree(qs.toJSON());
+		assertEquals("korap:doc", 		res.at("/collection/@type").asText());
+		assertEquals("pubDate", 		res.at("/collection/key").asText());
+		assertEquals("2000-01-01", 		res.at("/collection/value").asText());
+		assertEquals("type:date", 		res.at("/collection/type").asText());
+		assertEquals("match:leq", 		res.at("/collection/match").asText());
+	}
 }
 
