Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Solrj を使用して Solr インデックス内のドキュメントの総数を確認するにはどうすればよいですか?
自分で何時間も検索した後、実際に答えがあります(以下に示します)。他の人がより簡単に解決策を見つけられるように、この質問を投稿するだけです。
これが私が使用しているものです。これはカノニカルですか?より良い方法はありますか?
SolrQuery q = new SolrQuery("*:*"); q.setRows(0); // don't actually request any data return server.query(q).getResults().getNumFound();