Solr/Solrj: How can I determine the total number of documents in an index?
Here’s what I’m using. Is this canonical? Is there a better way? SolrQuery q = new SolrQuery(“*:*”); q.setRows(0); // don’t actually request any data return server.query(q).getResults().getNumFound();