Apache Solr open-source search software
LUCENE-1131 - Added numDeletedDocs() to IndexReader
Otis Gospodnetic8d02d7859f9a
diff --git a/CHANGES.txt b/CHANGES.txtindex e2922e71738..a9b8006833c 100644--- a/CHANGES.txt+++ b/CHANGES.txt@@ -154,6 +154,8 @@ API ChangesNO_NORMS becomes NOT_ANALYZED_NO_NORMS and a new ANALYZED_NO_NORMSis added. (Mike McCandless)+24. LUCENE-1131: Added numDeletedDocs method to IndexReader (Otis Gospodnetic)+Bug fixes1. LUCENE-1134: Fixed BooleanQuery.rewrite to only optimize a singlediff --git a/src/java/org/apache/lucene/index/IndexReader.java b/src/java/org/apache/lucene/index/IndexReader.javaindex a934a82ca67..394b46620c0 100644--- a/src/java/org/apache/lucene/index/IndexReader.java+++ b/src/java/org/apache/lucene/index/IndexReader.java@@ -622,6 +622,11 @@ public abstract class IndexReader {*/public abstract int maxDoc();+ /** Returns the number of deleted documents. */+ public int numDeletedDocs() {+ return maxDoc() - numDocs();+ }+/** Returns the stored fields of the <code>n</code><sup>th</sup><code>Document</code> in this index.* @throws CorruptIndexException if the index is corrupt