fix issue 24
Change-Id: I1a15fb22688cf07470746f693df825c4738ed783
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 643eb08..c8f6c56 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
@@ -178,8 +178,8 @@
List errors = (List) requestMap.get("errors");
List warnings = (List) requestMap.get("warnings");
List messages = (List) requestMap.get("messages");
- this.collection = mergeCollection(collection, this.collection);
- requestMap.put("collection", this.collection);
+ collection = mergeCollection(collection, this.collection);
+ requestMap.put("collection", collection);
if (this.meta != null) {
this.meta.putAll(meta);
requestMap.put("meta", this.meta);
@@ -226,6 +226,8 @@
return collection2;
}else if (collection2 == null || collection2.isEmpty()) {
return collection1;
+ }else if (collection1.equals(collection2)) {
+ return collection1;
}else {
LinkedHashMap<String, Object> docGroup = KoralObjectGenerator
.makeDocGroup("and");