mirror of
https://github.com/apache/lucene.git
synced 2025-02-15 22:45:52 +00:00
Today we have #numDocs() and #maxDoc() on IndexWriter. This is enough to get all stats for the current index but it's subject to concurrency and might return numbers that are not consistent ie. some cases can return maxDoc < numDocs which is undesirable. This change adds a getDocStats() method to index writer to allow fetching consistent numbers for these stats. This change also deprecates IndexWriter#numDocs() and IndexWriter#maxDoc() and replaces all their usages wiht IndexWriter#getDocStats()