diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQuery.java b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQuery.java
index d6ec238..63ae367 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQuery.java
@@ -26,6 +26,10 @@
     private Multimap<String, String> mextension;
 
 
+    public enum RELATION {
+        AND, OR
+    }
+
     public CollectionQuery() {
         this.rq = new ArrayList<>();
         this.mfilter = ArrayListMultimap.create();
@@ -42,16 +46,6 @@
             throw new IllegalArgumentException("Conversion went wrong!");
         }
 
-
-//        try {
-//            JsonParser jp = factory.createParser(query);
-//            JsonNode m = jp.readValueAsTree();
-//            for (JsonNode n : m)
-//                this.rq.add(serialzer.treeToValue(n, Map.class));
-//        } catch (IOException e) {
-//            e.printStackTrace();
-//            throw new IllegalArgumentException("Conversion went wrong!");
-//        }
         return this;
     }
 
@@ -61,14 +55,13 @@
         return this;
     }
 
-
     public CollectionQuery addMetaFilter(String key, String value) {
         this.mfilter.put(key, value);
         return this;
     }
 
-    public CollectionQuery addMetaFilter(String queries) {
-        this.mfilter.putAll(resEq(queries));
+    public CollectionQuery addMetaFilter(String queries, RELATION rel) {
+        this.mfilter.putAll(resRel(queries, rel));
         return this;
     }
 
@@ -77,13 +70,15 @@
         return this;
     }
 
-    public CollectionQuery addMetaExtend(String queries) {
-        this.mextension.putAll(resEq(queries));
+    public CollectionQuery addMetaExtend(String queries, RELATION rel) {
+        this.mextension.putAll(resRel(queries, rel));
+
         return this;
     }
 
 
-    private List<Map> createFilter() {
+    private List<Map> createFilter(RELATION rel) {
+        String relation = rel == RELATION.AND ? "and" : "or";
         List<Map> mfil = new ArrayList();
         boolean multypes = this.mfilter.keySet().size() > 1;
         String def_key = null;
@@ -100,15 +95,16 @@
         else {
             Map group;
             if (!multypes)
-                group = types.createGroup("and", def_key, value);
+                group = types.createGroup(relation, def_key, value);
             else
-                group = types.createGroup("and", null, value);
+                group = types.createGroup(relation, null, value);
             Collections.addAll(mfil, types.createMetaFilter(group));
         }
         return mfil;
     }
 
-    private List<Map> createExtender() {
+    private List<Map> createExtender(RELATION rel) {
+        String relation = rel == RELATION.AND ? "and" : "or";
         List<Map> mex = new ArrayList();
         boolean multypes = this.mextension.keys().size() > 1;
         String def_key = null;
@@ -123,20 +119,20 @@
         else {
             Map group;
             if (!multypes)
-                group = types.createGroup("and", def_key, value);
+                group = types.createGroup(relation, def_key, value);
             else
-                group = types.createGroup("and", null, value);
+                group = types.createGroup(relation, null, value);
             Collections.addAll(mex, types.createMetaExtend(group));
         }
         return mex;
     }
 
-    private List<Map> join() {
+    private List<Map> join(RELATION filter, RELATION extension) {
         List<Map> cursor = new ArrayList<>(this.rq);
         if (!this.mfilter.isEmpty())
-            cursor.addAll(this.createFilter());
+            cursor.addAll(this.createFilter(filter));
         if (!this.mextension.isEmpty())
-            cursor.addAll(this.createExtender());
+            cursor.addAll(this.createExtender(extension));
         return cursor;
     }
 
@@ -216,14 +212,14 @@
         return el;
     }
 
-    public List<Map> raw() {
-        return join();
+    public List<Map> raw(RELATION filter, RELATION extension) {
+        return join(filter, extension);
     }
 
 
-    public String toCollections() {
+    public String toCollections(RELATION filter, RELATION extension) {
         Map meta = new LinkedHashMap();
-        meta.put("collections", join());
+        meta.put("collections", join(filter, extension));
 
         try {
             return serialzer.writeValueAsString(meta);
@@ -233,19 +229,23 @@
         }
     }
 
+    public String toCollections() {
+        return toCollections(RELATION.AND, RELATION.AND);
+    }
+
 
     /**
      * returns all references to parents and meta query as string representation
      *
      * @return
      */
-    public JsonNode buildNode() {
-        return serialzer.valueToTree(join());
+    public JsonNode buildNode(RELATION filter, RELATION extension) {
+        return serialzer.valueToTree(join(filter, extension));
     }
 
-    public String buildString() {
+    public String buildString(RELATION filter, RELATION extension) {
         try {
-            return serialzer.writeValueAsString(join());
+            return serialzer.writeValueAsString(join(filter, extension));
         } catch (JsonProcessingException e) {
             e.printStackTrace();
             return "";
@@ -260,9 +260,9 @@
      * @param queries
      * @return
      */
-    private Multimap<String, String> resEq(String queries) {
+    private Multimap<String, String> resRel(String queries, RELATION rel) {
         Multimap<String, String> qmap = ArrayListMultimap.create();
-        String[] spl = queries.split(" AND ");
+        String[] spl = queries.split(rel.toString());
         for (String query : spl) {
             String[] q = query.split(":");
             String attr = q[0];
diff --git a/src/test/java/MetaQuerySerializationTest.java b/src/test/java/MetaQuerySerializationTest.java
index 7e430fa..2f7d8c3 100644
--- a/src/test/java/MetaQuerySerializationTest.java
+++ b/src/test/java/MetaQuerySerializationTest.java
@@ -4,7 +4,6 @@
 import de.ids_mannheim.korap.query.serialize.CollectionQuery;
 import de.ids_mannheim.korap.query.serialize.QuerySerializer;
 import de.ids_mannheim.korap.util.QueryException;
-
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -30,9 +29,10 @@
         b.append(" AND ");
         b.append("textClass:wissenschaft");
 //        CollectionQuery qu = new CollectionQuery().addMetaFilter(b.toString());
-        CollectionQuery query = new CollectionQuery().addMetaFilter(b.toString());
-        System.out.println(query.buildString());
-        System.out.println(query.toCollections());
+        CollectionQuery query = new CollectionQuery().addMetaFilter(b.toString(),
+                CollectionQuery.RELATION.AND);
+        System.out.println(query.buildString(CollectionQuery.RELATION.AND, CollectionQuery.RELATION.AND));
+        System.out.println(query.toCollections(CollectionQuery.RELATION.AND, CollectionQuery.RELATION.AND));
 //        System.out.println("value reference " + qu.stringify());
 //        System.out.println();
     }
@@ -41,7 +41,7 @@
     public void testSingle() throws IOException {
         CollectionQuery query = new CollectionQuery().addMetaFilter("textClass", "wissenschaft");
 //        System.out.println("------ TEXT SINGLE " + query.stringify());
-        System.out.println(query.buildString());
+        System.out.println(query.buildString(CollectionQuery.RELATION.AND, CollectionQuery.RELATION.AND));
     }
 
     @Test
@@ -52,10 +52,10 @@
         b.append("pubDate:<2012-04-01");
         b.append(" AND ");
         b.append("author:Goethe");
-        CollectionQuery query = new CollectionQuery().addMetaFilter(b.toString());
-        System.out.println("value until/since : " + query.buildString());
-        System.out.println("meta value until/since " + query.toCollections());
-        Assert.assertEquals("[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:group\",\"relation\":\"and\",\"operands\":[{\"@type\":\"korap:term\",\"@field\":\"korap:field#author\",\"@value\":\"Goethe\"},{\"@type\":\"korap:group\",\"@field\":\"korap:field#pubDate\",\"relation\":\"between\",\"operands\":[{\"@type\":\"korap:date\",\"@value\":\"2012-04-01\"},{\"@type\":\"korap:date\",\"@value\":\"2013-04-01\"}]}]}}]", query.buildString());
+        CollectionQuery query = new CollectionQuery().addMetaFilter(b.toString(), CollectionQuery.RELATION.AND);
+        System.out.println("value until/since : " + query.buildString(CollectionQuery.RELATION.AND, CollectionQuery.RELATION.AND));
+        System.out.println("meta value until/since " + query.toCollections(CollectionQuery.RELATION.AND, CollectionQuery.RELATION.AND));
+        Assert.assertEquals("[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:group\",\"relation\":\"and\",\"operands\":[{\"@type\":\"korap:term\",\"@field\":\"korap:field#author\",\"@value\":\"Goethe\"},{\"@type\":\"korap:group\",\"@field\":\"korap:field#pubDate\",\"relation\":\"between\",\"operands\":[{\"@type\":\"korap:date\",\"@value\":\"2012-04-01\"},{\"@type\":\"korap:date\",\"@value\":\"2013-04-01\"}]}]}}]", query.buildString(CollectionQuery.RELATION.AND, CollectionQuery.RELATION.AND));
 //        System.out.println();
     }
 
@@ -65,9 +65,9 @@
         b.append("pubDate:>2013-12-10");
         b.append(" AND ");
         b.append("author:Hesse");
-        CollectionQuery query = new CollectionQuery().addMetaFilter(b.toString());
+        CollectionQuery query = new CollectionQuery().addMetaFilter(b.toString(), CollectionQuery.RELATION.AND);
         System.out.println("Running date check (until) with additional attribute author");
-        Assert.assertEquals("[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:group\",\"relation\":\"and\",\"operands\":[{\"@type\":\"korap:term\",\"@field\":\"korap:field#author\",\"@value\":\"Hesse\"},{\"@type\":\"korap:group\",\"@field\":\"korap:field#pubDate\",\"relation\":\"until\",\"operands\":[{\"@type\":\"korap:date\",\"@value\":\"2013-12-10\"}]}]}}]", query.buildString());
+        Assert.assertEquals("[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:group\",\"relation\":\"and\",\"operands\":[{\"@type\":\"korap:term\",\"@field\":\"korap:field#author\",\"@value\":\"Hesse\"},{\"@type\":\"korap:group\",\"@field\":\"korap:field#pubDate\",\"relation\":\"until\",\"operands\":[{\"@type\":\"korap:date\",\"@value\":\"2013-12-10\"}]}]}}]", query.buildString(CollectionQuery.RELATION.AND, CollectionQuery.RELATION.AND));
 //        System.out.println("value until : " + query.stringify());
 //        System.out.println();
     }
@@ -78,12 +78,13 @@
         b.append("pubDate:<2013-12-10");
         b.append(" AND ");
         b.append("author:Kafka");
-        CollectionQuery query = new CollectionQuery().addMetaFilter(b.toString());
-        System.out.println("value since : " + query.buildString());
-        System.out.println("meta value since " + query.toCollections());
+        CollectionQuery query = new CollectionQuery().addMetaFilter(b.toString(), CollectionQuery.RELATION.AND);
+        System.out.println("value since : " + query.buildString(CollectionQuery.RELATION.AND,
+                CollectionQuery.RELATION.AND));
+        System.out.println("meta value since " + query.toCollections(CollectionQuery.RELATION.AND, CollectionQuery.RELATION.AND));
 //        System.out.println();
         System.out.println("Running date check (since) with additional attribute author");
-        Assert.assertEquals("[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:group\",\"relation\":\"and\",\"operands\":[{\"@type\":\"korap:term\",\"@field\":\"korap:field#author\",\"@value\":\"Kafka\"},{\"@type\":\"korap:group\",\"@field\":\"korap:field#pubDate\",\"relation\":\"since\",\"operands\":[{\"@type\":\"korap:date\",\"@value\":\"2013-12-10\"}]}]}}]", query.buildString());
+        Assert.assertEquals("[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:group\",\"relation\":\"and\",\"operands\":[{\"@type\":\"korap:term\",\"@field\":\"korap:field#author\",\"@value\":\"Kafka\"},{\"@type\":\"korap:group\",\"@field\":\"korap:field#pubDate\",\"relation\":\"since\",\"operands\":[{\"@type\":\"korap:date\",\"@value\":\"2013-12-10\"}]}]}}]", query.buildString(CollectionQuery.RELATION.AND, CollectionQuery.RELATION.AND));
     }
 
     @Test
@@ -126,10 +127,10 @@
         b.append("pubDate:<2013-12-10");
         b.append(" AND ");
         b.append("author:Kafka");
-        CollectionQuery q = new CollectionQuery().addMetaFilter(b.toString());
+        CollectionQuery q = new CollectionQuery().addMetaFilter(b.toString(), CollectionQuery.RELATION.AND);
         q.addMetaExtend("author", "Hesse");
 
-        System.out.println("--- ALL " + q.buildString());
+        System.out.println("--- ALL " + q.buildString(CollectionQuery.RELATION.AND, CollectionQuery.RELATION.AND));
         System.out.println();
 
     }
@@ -140,8 +141,8 @@
         b.append("pubDate:<2013-12-10");
         b.append(" AND ");
         b.append("author:Kafka");
-        CollectionQuery q = new CollectionQuery().addMetaExtend(b.toString());
-        System.out.println("array repres " + q.buildString());
+        CollectionQuery q = new CollectionQuery().addMetaExtend(b.toString(), CollectionQuery.RELATION.AND);
+        System.out.println("array repres " + q.buildString(CollectionQuery.RELATION.AND, CollectionQuery.RELATION.AND));
         System.out.println();
     }
 
@@ -150,8 +151,8 @@
         CollectionQuery q = new CollectionQuery().addMetaFilter("corpusID", "A00");
         q.addMetaExtend("corpusID", "A01");
 
-        System.out.println("results stringified " + q.buildString());
-        System.out.println("results to meta" + q.toCollections());
+        System.out.println("results stringified " + q.buildString(CollectionQuery.RELATION.AND, CollectionQuery.RELATION.AND));
+        System.out.println("results to meta" + q.toCollections(CollectionQuery.RELATION.AND, CollectionQuery.RELATION.AND));
         System.out.println();
     }
 
@@ -166,13 +167,13 @@
         String meta = "[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:term\",\"@field\":\"korap:field#corpusID\",\"@value\":\"WPD\"}}]";
         CollectionQuery q = new CollectionQuery().addResource(meta);
         System.out.println("Testing Resource Meta data");
-        org.junit.Assert.assertEquals("{\"collections\":" + meta + "}", q.toCollections());
+        org.junit.Assert.assertEquals("{\"collections\":" + meta + "}", q.toCollections(CollectionQuery.RELATION.AND, CollectionQuery.RELATION.AND));
     }
 
     @Test
     public void testA00() throws IOException {
         CollectionQuery q = new CollectionQuery().addMetaExtend("corpusID", "A00").addMetaExtend("corpusID", "A01");
-        System.out.println("A meta: " + q.buildString());
+        System.out.println("A meta: " + q.buildString(CollectionQuery.RELATION.AND, CollectionQuery.RELATION.AND));
         System.out.println();
     }
 
@@ -181,8 +182,8 @@
         String meta = "[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:term\",\"@field\":\"korap:field#corpusID\",\"@value\":\"WPD\"}}]";
         CollectionQuery q = new CollectionQuery().addResource(meta);
         q.addMetaFilter("textClass", "wissenschaft");
-        System.out.println("stringified meta " + q.buildString());
-        System.out.println("meta string " + q.toCollections());
+        System.out.println("stringified meta " + q.buildString(CollectionQuery.RELATION.AND, CollectionQuery.RELATION.AND));
+        System.out.println("meta string " + q.toCollections(CollectionQuery.RELATION.AND, CollectionQuery.RELATION.AND));
     }
 
 }
