mirror of https://github.com/apache/lucene.git
SOLR-1566: fix /browse wrt pseudo fields
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1091797 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
34533ad635
commit
f777daef3d
|
@ -19,8 +19,10 @@ package org.apache.solr.response;
|
|||
|
||||
import org.apache.solr.request.SolrQueryRequest;
|
||||
import org.apache.solr.response.SolrQueryResponse;
|
||||
import org.apache.solr.search.DocList;
|
||||
import org.apache.solr.search.DocSlice;
|
||||
import org.apache.solr.common.SolrDocumentList;
|
||||
import org.apache.solr.common.SolrException;
|
||||
|
||||
public class PageTool {
|
||||
private long start;
|
||||
|
@ -42,10 +44,16 @@ public class PageTool {
|
|||
DocSlice doc_slice = (DocSlice) docs;
|
||||
results_found = doc_slice.matches();
|
||||
start = doc_slice.offset();
|
||||
} else {
|
||||
} else if(docs instanceof ResultContext) {
|
||||
DocList dl = ((ResultContext) docs).docs;
|
||||
results_found = dl.matches();
|
||||
start = dl.offset();
|
||||
} else if(docs instanceof SolrDocumentList) {
|
||||
SolrDocumentList doc_list = (SolrDocumentList) docs;
|
||||
results_found = doc_list.getNumFound();
|
||||
start = doc_list.getStart();
|
||||
} else {
|
||||
throw new SolrException(SolrException.ErrorCode.UNKNOWN, "Unknown response type "+docs+". Expected one of DocSlice, ResultContext or SolrDocumentList");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue