Skip to content

Apache Lucene open-source search software

add warnings to javadoc for IndexModifier.docCount

Michael McCandless59c8f9cd76f1
diff --git a/src/java/org/apache/lucene/index/IndexModifier.java b/src/java/org/apache/lucene/index/IndexModifier.java
index 9e2750c2ec7..f3428f4fdbb 100644
--- a/src/java/org/apache/lucene/index/IndexModifier.java
+++ b/src/java/org/apache/lucene/index/IndexModifier.java
@@ -338,9 +338,12 @@ public class IndexModifier {
/**
- * Returns the number of documents currently in this index.
- * @see IndexWriter#docCount()
- * @see IndexReader#numDocs()
+ * Returns the number of documents currently in this
+ * index. If the writer is currently open, this returns
+ * {@link IndexWriter#docCount()}, else {@link
+ * IndexReader#numDocs()}. But, note that {@link
+ * IndexWriter#docCount()} does not take deletions into
+ * account, unlike {@link IndexReader#numDocs}.
* @throws IllegalStateException if the index is closed
*/
public int docCount() {