Fixed containsnot deserialization
Change-Id: Ifbe5559996f458b8bc1dba92fd7983eb6af77a82
diff --git a/Changes b/Changes
index 6959658..b1c4a45 100644
--- a/Changes
+++ b/Changes
@@ -27,6 +27,8 @@
data fields (diewald)
- [bugfix] Fix case sensitivity bug in filters (diewald)
- [bugfix] Fix sentence expansion bug for new data (diewald)
+ - [bugfix] Deserialization of 'containsnot' instead of 'excludes'
+ (diewald)
0.51 2015-03-17
- This is a major version (prepared for the GitHub release)
diff --git a/src/main/java/de/ids_mannheim/korap/KrillCollection.java b/src/main/java/de/ids_mannheim/korap/KrillCollection.java
index 83e40fa..a89fdfc 100644
--- a/src/main/java/de/ids_mannheim/korap/KrillCollection.java
+++ b/src/main/java/de/ids_mannheim/korap/KrillCollection.java
@@ -239,9 +239,14 @@
else if (match.equals("match:contains")) {
bfilter.and(key, json.get("value").asText().toLowerCase());
}
+ else if (match.equals("match:containsnot")) {
+ bfilter.andNot(key, json.get("value").asText().toLowerCase());
+ }
+ // <LEGACY>
else if (match.equals("match:excludes")) {
bfilter.andNot(key, json.get("value").asText().toLowerCase());
}
+ // </LEGACY>
else {
throw new QueryException(0, "Unknown match type");
};
diff --git a/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionJSON.java b/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionJSON.java
index e518fb6..cbc60bc 100644
--- a/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionJSON.java
+++ b/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionJSON.java
@@ -97,7 +97,6 @@
};
-
@Ignore
public void nocollectiontypegiven () {
String metaQuery = _getJSONString("multiterm_rewrite_collection.jsonld");