我正在搜索一些文档,我想返回匹配的文档数量与索引的文档数量。
You could create a MatchAllDocsQuery which according to the javadocs states:
A query that matches all documents.
Otherwise perhaps the IndexReader might be useful:
IndexReader.open("path/to/index").numDocs();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.