tags:

views:

504

answers:

2

Using Java how would you find out the number of documents in an lucene index?

+4  A: 

IndexReader contains the methods you need, in particular, numDocs

http://hudson.zones.apache.org/hudson/job/Lucene-trunk/javadoc//org/apache/lucene/index/IndexReader.html#numDocs()

John Gardner
+1  A: 

The official documentation: http://lucene.apache.org/java/2_4_0/api/org/apache/lucene/index/IndexReader.html#numDocs()

Avi