I suppose you could write a component that just gets this info from SolrIndexSearcher and write that in the response?
Otis ---- Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch Lucene ecosystem search :: http://search-lucene.com/ ----- Original Message ---- > From: John DeRosa <jo...@ipstreet.com> > To: solr-user@lucene.apache.org > Sent: Fri, July 30, 2010 1:39:03 PM > Subject: Programmatically retrieving numDocs (or any other statistic) > > I want to programmatically retrieve the number of indexed documents. I.e., > get >the value of numDocs. > > The only two ways I've come up with are searching for "*:*" and reporting > the >hit count, or sending an Http GET to >http://xxx.xx.xxx.xxx:8080/solr/admin/stats.jsp#core and searching for <stat >name="numDocs" >xxxx </stat> in the response. > > Both seem to be overkill. Is there an easier way to ask SolrIndexSearcher, >"what's numDocs"? > > (I'm doing this in Python, using Pysolr, if that matters.) > > Thanks! > >