You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2014/01/17 14:36:45 UTC
svn commit: r1559102 -
/lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
Author: mikemccand
Date: Fri Jan 17 13:36:45 2014
New Revision: 1559102
URL: http://svn.apache.org/r1559102
Log:
improve javadocs
Modified:
lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
Modified: lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java?rev=1559102&r1=1559101&r2=1559102&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java Fri Jan 17 13:36:45 2014
@@ -1113,7 +1113,11 @@ public class IndexWriter implements Clos
}
/**
- * Returns true if this index has deletions (including buffered deletions).
+ * Returns true if this index has deletions (including
+ * buffered deletions). Note that this will return true
+ * if there are buffered Term/Query deletions, even if it
+ * turns out those buffered deletions don't match any
+ * documents.
*/
public synchronized boolean hasDeletions() {
ensureOpen();
@@ -2949,12 +2953,15 @@ public class IndexWriter implements Clos
commitInternal();
}
- /** Returns true if there are changes that have not been
- * committed. Note that if a merge kicked off as a
- * result of flushing a new segment during {@link
- * #commit}, or a concurrent merged finished,
- * this method may return true right after you
- * had just called {@link #commit}. */
+ /** Returns true if there may be changes that have not been
+ * committed. There are cases where this may return true
+ * when there are no actual "real" changes to the index,
+ * for example if you've deleted by Term or Query but
+ * that Term or Query does not match any documents.
+ * Also, if a merge kicked off as a result of flushing a
+ * new segment during {@link #commit}, or a concurrent
+ * merged finished, this method may return true right
+ * after you had just called {@link #commit}. */
public final boolean hasUncommittedChanges() {
return changeCount != lastCommitChangeCount || docWriter.anyChanges() || bufferedUpdatesStream.any();
}