Return-Path: Delivered-To: apmail-lucene-solr-commits-archive@minotaur.apache.org Received: (qmail 3200 invoked from network); 26 Nov 2009 08:25:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Nov 2009 08:25:55 -0000 Received: (qmail 85402 invoked by uid 500); 26 Nov 2009 08:25:55 -0000 Delivered-To: apmail-lucene-solr-commits-archive@lucene.apache.org Received: (qmail 85339 invoked by uid 500); 26 Nov 2009 08:25:55 -0000 Mailing-List: contact solr-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-dev@lucene.apache.org Delivered-To: mailing list solr-commits@lucene.apache.org Received: (qmail 85330 invoked by uid 99); 26 Nov 2009 08:25:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Nov 2009 08:25:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Nov 2009 08:25:52 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A6CF523888D1; Thu, 26 Nov 2009 08:25:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r884456 - /lucene/solr/trunk/src/java/org/apache/solr/request/BaseResponseWriter.java Date: Thu, 26 Nov 2009 08:25:31 -0000 To: solr-commits@lucene.apache.org From: noble@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091126082531.A6CF523888D1@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: noble Date: Thu Nov 26 08:25:30 2009 New Revision: 884456 URL: http://svn.apache.org/viewvc?rev=884456&view=rev Log: SOLR-1516 Modified: lucene/solr/trunk/src/java/org/apache/solr/request/BaseResponseWriter.java Modified: lucene/solr/trunk/src/java/org/apache/solr/request/BaseResponseWriter.java URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/request/BaseResponseWriter.java?rev=884456&r1=884455&r2=884456&view=diff ============================================================================== --- lucene/solr/trunk/src/java/org/apache/solr/request/BaseResponseWriter.java (original) +++ lucene/solr/trunk/src/java/org/apache/solr/request/BaseResponseWriter.java Thu Nov 26 08:25:30 2009 @@ -88,10 +88,9 @@ if (omitHeader == null || !omitHeader) responseWriter.writeResponseHeader((NamedList) val); } else if (val instanceof SolrDocumentList) { SolrDocumentList list = (SolrDocumentList) val; - DocListInfo info = new DocListInfo(list.getNumFound(), list.getStart(), - list.getMaxScore()); + DocListInfo info = new DocListInfo((int)list.getNumFound(), list.size(), (int)list.getStart(), list.getMaxScore()); if (responseWriter.isStreamingDocs()) { - responseWriter.startDocumentList(info); + responseWriter.startDocumentList(name,info); for (SolrDocument solrDocument : list) responseWriter.writeDoc(solrDocument); responseWriter.endDocumentList(); @@ -103,11 +102,11 @@ int sz = docList.size(); IdxInfo idxInfo = new IdxInfo(request.getSchema(), request .getSearcher(), response.getReturnFields()); - DocListInfo info = new DocListInfo(docList.matches(), docList.offset(), + DocListInfo info = new DocListInfo(docList.matches(), docList.size(),docList.offset(), docList.maxScore()); DocIterator iterator = docList.iterator(); if (responseWriter.isStreamingDocs()) { - responseWriter.startDocumentList(info); + responseWriter.startDocumentList(name,info); for (int j = 0; j < sz; j++) { SolrDocument sdoc = getDoc(iterator.nextDoc(), idxInfo); if (idxInfo.includeScore && docList.hasScores()) { @@ -207,12 +206,14 @@ } public static class DocListInfo { - public long numFound = 0; - public long start = 0; + public final int numFound; + public final int start ; public Float maxScore = null; + public final int size; - public DocListInfo(long numFound, long start, Float maxScore) { + public DocListInfo(int numFound, int sz,int start, Float maxScore) { this.numFound = numFound; + size = sz; this.start = start; this.maxScore = maxScore; } @@ -245,7 +246,7 @@ * * @param info Information about the {@link SolrDocumentList} to output. */ - public void startDocumentList(DocListInfo info) throws IOException { } + public void startDocumentList(String name, DocListInfo info) throws IOException { } /** * This method writes out a {@link SolrDocument}, on a doc-by-doc basis.