From: Niels Erik G. Nielsen Date: Wed, 4 Sep 2013 16:59:07 +0000 (-0400) Subject: Enables removal of limit by setting empty limit X-Git-Tag: v0.0.7~18 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=dff9a63520eeb6c4d6fd6b5e286e8f6a06c5608a;p=mkjsf-moved-to-github.git Enables removal of limit by setting empty limit --- diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/SearchCommand.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/SearchCommand.java index 7d74b6c..b8003cc 100644 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/SearchCommand.java +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/SearchCommand.java @@ -217,7 +217,13 @@ public class SearchCommand extends Pazpar2Command implements ServiceProxyCommand */ public void setLimit (String limitExpression) { if (limitExpression != null && limitExpression.length()>0) { - setParameter(new LimitParameter(new Expression(limitExpression))); + if (limitExpression.split("[=~]").length==1) { + removeLimits(limitExpression.split("[=~]")[0]); + } else if (limitExpression.split("[=~]").length==2) { + setParameter(new LimitParameter(new Expression(limitExpression))); + } else { + logger.error("Could not parse limit expression [" + limitExpression + "]"); + } } }