LUCENE-1131 - Added numDeletedDocs() to IndexReader

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@695510 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Otis Gospodnetic 2008-09-15 15:33:15 +00:00
parent d2aeaeeff2
commit 8d02d7859f
2 changed files with 7 additions and 0 deletions

View File

@ -154,6 +154,8 @@ API Changes
NO_NORMS becomes NOT_ANALYZED_NO_NORMS and a new ANALYZED_NO_NORMS
is added. (Mike McCandless)
24. LUCENE-1131: Added numDeletedDocs method to IndexReader (Otis Gospodnetic)
Bug fixes
1. LUCENE-1134: Fixed BooleanQuery.rewrite to only optimize a single

View File

@ -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