Skip to content

Apache Lucene open-source search software

LUCENE-4068: Improve IW#addDocuments(...) javadoc

Martijn van Groningen20f10be75b46
diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
index 28d16a8ef4f..d229c71d39a 100644
--- a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
@@ -1041,12 +1041,19 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {
*
* <p><b>WARNING</b>: the index does not currently record
* which documents were added as a block. Today this is
- * fine, because merging will preserve the block (as long
- * as none them were deleted). But it's possible in the
- * future that Lucene may more aggressively re-order
- * documents (for example, perhaps to obtain better index
- * compression), in which case you may need to fully
- * re-index your documents at that time.
+ * fine, because merging will preserve a block. The order of
+ * documents within a segment will be preserved, even when child
+ * documents within a block are deleted. Most search features
+ * (like result grouping and block joining) require you to
+ * mark documents; when these documents are deleted these
+ * search features will not work as expected. Obviously adding
+ * documents to an existing block will require you the reindex
+ * the entire block.
+ *
+ * <p>However it's possible that in the future Lucene may
+ * merge more aggressively re-order documents (for example,
+ * perhaps to obtain better index compression), in which case
+ * you may need to fully re-index your documents at that time.
*
* <p>See {@link #addDocument(Iterable)} for details on
* index and IndexWriter state after an Exception, and