updates
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQuery.java b/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQuery.java
index 41ebd01..2d81800 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQuery.java
@@ -254,7 +254,6 @@
* @return
*/
private Multimap<String, String> resEq(String queries) {
- System.out.println("======= ENTERED QUERIES " + queries + " =======");
Multimap<String, String> qmap = ArrayListMultimap.create();
String[] spl = queries.split(" AND ");
for (String query : spl) {
diff --git a/src/test/java/MetaQuerySerializationTest.java b/src/test/java/MetaQuerySerializationTest.java
index 580d2be..f9a13cf 100644
--- a/src/test/java/MetaQuerySerializationTest.java
+++ b/src/test/java/MetaQuerySerializationTest.java
@@ -43,21 +43,22 @@
@Test
public void testDates() throws IOException {
StringBuffer b = new StringBuffer();
- b.append("pubDate:<" + String.valueOf(new DateTime().getMillis()));
+ b.append("pubDate:>2013-04-01");
b.append(" AND ");
- b.append("pubDate:>" + String.valueOf(new DateTime().getMillis() + 2));
+ b.append("pubDate:<2012-04-01");
b.append(" AND ");
b.append("author:Goethe");
MetaQuery query = new MetaQuery().addMetaFilter(b.toString());
-// System.out.println("value until/since : " + query.stringify());
- 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\":\"2013-12-10\"},{\"@type\":\"korap:date\",\"@value\":\"2013-12-10\"}]}]}}]", query.stringify());
+ System.out.println("value until/since : " + query.stringify());
+ System.out.println("meta value until/since " + query.toMeta());
+ 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.stringify());
// System.out.println();
}
@Test
public void testUntil() throws IOException {
StringBuffer b = new StringBuffer();
- b.append("pubDate:>" + String.valueOf(new DateTime().getMillis()));
+ b.append("pubDate:>2013-12-10");
b.append(" AND ");
b.append("author:Hesse");
MetaQuery query = new MetaQuery().addMetaFilter(b.toString());
@@ -70,11 +71,12 @@
@Test
public void testSince() throws IOException {
StringBuffer b = new StringBuffer();
- b.append("pubDate:<" + String.valueOf(new DateTime().getMillis()));
+ b.append("pubDate:<2013-12-10");
b.append(" AND ");
b.append("author:Kafka");
MetaQuery query = new MetaQuery().addMetaFilter(b.toString());
-// System.out.println("value since : " + query.stringify());
+ System.out.println("value since : " + query.stringify());
+ System.out.println("meta value since " + query.toMeta());
// 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.stringify());
@@ -117,7 +119,7 @@
@Test
public void testLists() {
StringBuffer b = new StringBuffer();
- b.append("pubDate:<" + String.valueOf(new DateTime().getMillis()));
+ b.append("pubDate:<2013-12-10");
b.append(" AND ");
b.append("author:Kafka");
MetaQuery query = new MetaQuery().addMetaFilter(b.toString());
@@ -131,7 +133,7 @@
@Test
public void testJSONArray() throws JsonProcessingException {
StringBuffer b = new StringBuffer();
- b.append("pubDate:<" + String.valueOf(new DateTime().getMillis()));
+ b.append("pubDate:<2013-12-10");
b.append(" AND ");
b.append("author:Kafka");
MetaQuery q = new MetaQuery().addMetaExtend(b.toString());