meta query builder update
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQueryBuilder.java b/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQueryBuilder.java
index 09c3c1a..0e41a76 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQueryBuilder.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQueryBuilder.java
@@ -30,8 +30,8 @@
* @param rightType
* @return
*/
- public MetaQueryBuilder setContext(Integer left, String leftType,
- Integer right, String rightType) {
+ public MetaQueryBuilder setSpanContext(Integer left, String leftType,
+ Integer right, String rightType) {
this.spanContext = new SpanContext(left, leftType, right, rightType);
return this;
}
@@ -47,7 +47,7 @@
* @param context
* @return
*/
- public MetaQueryBuilder setContext(String context) {
+ public MetaQueryBuilder setSpanContext(String context) {
if (context.startsWith("s") | context.startsWith("p"))
this.spanContext = new SpanContext(context);
else {
@@ -69,7 +69,7 @@
if (pageLength != null)
this.addEntry("count", pageLength);
if (ctx != null)
- this.setContext(ctx);
+ this.setSpanContext(ctx);
if (cutoff != null)
this.addEntry("cutOff", cutoff);
return this;
@@ -82,7 +82,8 @@
}
public Map raw() {
- meta.putAll(this.spanContext.raw());
+ if (this.spanContext != null)
+ meta.putAll(this.spanContext.raw());
return meta;
}
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 950befa..a048ecf 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
@@ -157,7 +157,7 @@
String cli, String cri, int cls, int crs,
int num, int pageIndex) {
MetaQueryBuilder meta = new MetaQueryBuilder();
- meta.setContext(cls, cli, crs, cri);
+ meta.setSpanContext(cls, cli, crs, cri);
meta.addEntry("startIndex", pageIndex);
meta.addEntry("count", num);
this.meta = meta.raw();
@@ -168,7 +168,7 @@
MetaQueryBuilder meta = new MetaQueryBuilder();
meta.addEntry("startIndex", pageidx);
meta.addEntry("count", num);
- meta.setContext(context);
+ meta.setSpanContext(context);
return this;
}