responseWriter.endDocumentList();
} else {
responseWriter.writeAllDocs(info, list);
}
} else if (val instanceof DocList) {
DocList docList = (DocList) val;
int sz = docList.size();
IdxInfo idxInfo = new IdxInfo(request.getSchema(), request
.getSearcher(), response.getReturnFields());
DocListInfo info = new DocListInfo(docList.matches(), docList.size(),docList.offset(),
docList.maxScore());
DocIterator iterator = docList.iterator();
if (responseWriter.isStreamingDocs()) {
responseWriter.startDocumentList(name,info);
for (int j = 0; j < sz; j++) {
SolrDocument sdoc = getDoc(iterator.nextDoc(), idxInfo);
if (idxInfo.includeScore && docList.hasScores()) {
sdoc.addField(SCORE_FIELD, iterator.score());
}
responseWriter.writeDoc(sdoc);
}
} else {
ArrayList<SolrDocument> list = new ArrayList<SolrDocument>(docList
.size());
for (int j = 0; j < sz; j++) {
SolrDocument sdoc = getDoc(iterator.nextDoc(), idxInfo);
if (idxInfo.includeScore && docList.hasScores()) {
sdoc.addField(SCORE_FIELD, iterator.score());
}
list.add(sdoc);
}
responseWriter.writeAllDocs(info, list);