lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Karich <peat...@yahoo.de>
Subject Re: Programmatically retrieving numDocs (or any other statistic)
Date Fri, 30 Jul 2010 20:11:33 GMT
Both approaches are ok, I think. (although I don't know the python API)
BTW: If you query q=*:* then add rows=0 to avoid some traffic.

Regards,
Peter.

> 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!

Mime
View raw message