Skip to content

Apache Lucene open-source search software

javadoc improvement: clarify impact of IndexWriter's autoCommit flag on IndexReader's isCurrent method

Michael McCandless4ef95040cbfd
diff --git a/src/java/org/apache/lucene/index/IndexReader.java b/src/java/org/apache/lucene/index/IndexReader.java
index 2f32b48863c..cf88df1ee1e 100644
--- a/src/java/org/apache/lucene/index/IndexReader.java
+++ b/src/java/org/apache/lucene/index/IndexReader.java
@@ -322,9 +322,15 @@ public abstract class IndexReader {
}
/**
- * Check whether this IndexReader still works on a current version of the index.
- * If this is not the case you will need to re-open the IndexReader to
- * make sure you see the latest changes made to the index.
+ * Check whether this IndexReader is still using the
+ * current (i.e., most recently committed) version of the
+ * index. If a writer has committed any changes to the
+ * index since this reader was opened, this will return
+ * <code>false</code>, in which case you must open a new
+ * IndexReader in order to see the changes. See the
+ * description of the <a href="IndexWriter.html#autoCommit"><code>autoCommit</code></a>
+ * flag which controls when the {@link IndexWriter}
+ * actually commits changes to the index.
*
* @throws CorruptIndexException if the index is corrupt
* @throws IOException if there is a low-level IO error