Added warning for optional queries
diff --git a/src/main/java/de/ids_mannheim/korap/KorapSearch.java b/src/main/java/de/ids_mannheim/korap/KorapSearch.java
index f0a1012..c86c0d4 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapSearch.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapSearch.java
@@ -54,7 +54,11 @@
// "query" value
if (this.request.has("query")) {
try {
- this.query = new KorapQuery("tokens").fromJSON(this.request.get("query")).toQuery();
+ SpanQueryWrapperInterface queryIface = new KorapQuery("tokens").fromJSON(this.request.get("query"));
+
+ this.query = queryIface.toQuery();
+ if (queryIface.isOptional())
+ this.addWarning("Optionality of query is ignored");
}
catch (QueryException q) {
this.error = q.getMessage();