Hi all

In my Solr 6.6 based code, I have the following line that get the total
number of documents in a collection:

totalDocs=indexSearcher.getStatistics().get("numDocs"))

where indexSearcher is an instance of "SolrIndexSearcher".


With Solr 7.2.1, 'getStatistics' is no longer available, and it seems that
it is replaced by 'collectionStatistics' or 'termStatistics':
https://lucene.apache.org/solr/7_2_1/solr-core/org/apache/solr/search/SolrIndexSearcher.html?is-external=true

So my questions is what is the equivalent statement in solr 7.2.1? Is it:

solrIndexSearcher.collectionStatistics("numDocs").maxDoc();

The API warns that it is still experimental and might change in
incompatible ways in the next release. Is there more 'stable' code for
getting this done?

Thanks

Reply via email to