开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜