开发者

How can I retrieve the total number of documents indexed by Lucene in 3.0.2?

开发者 https://www.devze.com 2023-02-15 22:12 出处:网络
I\'m searching through开发者_运维百科 some documents, and I\'d like to return the amount of matching documentsagainst the amount of documents indexed.You could create a MatchAllDocsQuery which accordi

I'm searching through开发者_运维百科 some documents, and I'd like to return the amount of matching documents against the amount of documents indexed.


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();
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号