Default number of rows to 10 if not specified. Fixes issue with calculation of number of pages

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@755993 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Erik Hatcher 2009-03-19 13:40:44 +00:00
parent b46fca3934
commit c26c959710
1 changed files with 3 additions and 2 deletions

View File

@ -21,7 +21,7 @@ import org.apache.solr.search.DocSlice;
public class PageTool { public class PageTool {
private long start; private long start;
private int results_per_page; private int results_per_page = 10;
private long results_found; private long results_found;
private int page_count; private int page_count;
private int current_page_number; private int current_page_number;
@ -29,8 +29,9 @@ public class PageTool {
public PageTool(SolrQueryRequest request, SolrQueryResponse response) { public PageTool(SolrQueryRequest request, SolrQueryResponse response) {
String rows = request.getParams().get("rows"); String rows = request.getParams().get("rows");
if (rows != null) if (rows != null) {
results_per_page = new Integer(rows); results_per_page = new Integer(rows);
}
DocSlice doc_slice = (DocSlice) response.getValues().get("response"); DocSlice doc_slice = (DocSlice) response.getValues().get("response");