Skip to content

Apache Lucene open-source search software

let SolrQuery take null start/rows to remove them (rather then throw NPE)

Ryan McKinley2a074e6dc1f5
diff --git a/client/java/solrj/src/org/apache/solr/client/solrj/SolrQuery.java b/client/java/solrj/src/org/apache/solr/client/solrj/SolrQuery.java
index ffb0dbe9f82..0a4890ad6b0 100644
--- a/client/java/solrj/src/org/apache/solr/client/solrj/SolrQuery.java
+++ b/client/java/solrj/src/org/apache/solr/client/solrj/SolrQuery.java
@@ -372,7 +372,12 @@ public class SolrQuery extends ModifiableSolrParams
}
public void setRows(Integer rows) {
- this.set(CommonParams.ROWS, rows);
+ if( rows == null ) {
+ this.remove( CommonParams.ROWS );
+ }
+ else {
+ this.set(CommonParams.ROWS, rows);
+ }
}
public Integer getRows()
@@ -390,7 +395,12 @@ public class SolrQuery extends ModifiableSolrParams
// }
public void setStart(Integer start) {
- this.set(CommonParams.START, start);
+ if( start == null ) {
+ this.remove( CommonParams.START );
+ }
+ else {
+ this.set(CommonParams.START, start);
+ }
}
public Integer getStart()