fields set
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/LightService.java b/src/main/java/de/ids_mannheim/korap/web/service/LightService.java
index 6e54744..29599a3 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/LightService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/LightService.java
@@ -123,7 +123,8 @@
MetaQueryBuilder meta = QueryBuilderUtil
.defaultMetaBuilder(pageIndex, pageInteger, pageLength, ctx,
cutoff);
- meta.addEntry("fields", fields);
+ if (fields != null && !fields.isEmpty())
+ meta.addEntry("fields", fields);
serializer.setMeta(meta);
if (cq != null)
serializer.setCollection(cq);
diff --git a/src/test/java/MetaQueryBuilderTest.java b/src/test/java/MetaQueryBuilderTest.java
deleted file mode 100644
index 7b4c3aa..0000000
--- a/src/test/java/MetaQueryBuilderTest.java
+++ /dev/null
@@ -1,45 +0,0 @@
-import com.fasterxml.jackson.databind.JsonNode;
-import de.ids_mannheim.korap.query.serialize.MetaQueryBuilder;
-import de.ids_mannheim.korap.utils.JsonUtils;
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.util.HashSet;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * @author hanl
- * @date 26/06/2015
- */
-public class MetaQueryBuilderTest {
-
- private static Pattern p = Pattern
- .compile("^/\\s*\\d+-(?:c(?:hars?)?|t(?:okens)?)$/");
-
- private static Pattern p3 = Pattern
- .compile("\\d+-(c(?:hars?)?|t(?:okens)?)?");
-
- @Test
- public void testRegex() {
- Matcher m = p.matcher("1-tokens,2-chars");
- while (m.find()) {
- int size = m.groupCount();
- System.out.println("FOUND ");
- for (int i = 0; i < size; i++)
- System.out.println("GROUP " + m.group(i));
- }
- }
-
- @Test
- public void testMetaBuilder() {
- Set<String> f = new HashSet<>();
- f.add("docID");
- f.add("corpusID");
- MetaQueryBuilder m = new MetaQueryBuilder();
- m.addEntry("fields", f);
- JsonNode n = JsonUtils.readTree(JsonUtils.toJSON(m.raw()));
- Assert.assertEquals("[\"docID\",\"corpusID\"]", n.at("/fields").toString());
- }
-}