Apache Lucene.Net 2.4.0 Class Library API

IndexWriter.ExpungeDeletes Method

Expunges all deletes from the index. When an index has many document deletions (or updates to existing documents), it's best to either call optimize or expungeDeletes to remove all unused data in the index associated with the deleted documents. To see how many deletions you have pending in your index, call {@link IndexReader#numDeletedDocs} This saves disk space and memory usage while searching. expungeDeletes should be somewhat faster than optimize since it does not insist on reducing the index to a single segment (though, this depends on the {@link MergePolicy}; see {@link MergePolicy#findMergesToExpungeDeletes}.). Note that this call does not first commit any buffered documents, so you must do so yourself if necessary. See also {@link #expungeDeletes(bool)}

Overload List

Expunges all deletes from the index. When an index has many document deletions (or updates to existing documents), it's best to either call optimize or expungeDeletes to remove all unused data in the index associated with the deleted documents. To see how many deletions you have pending in your index, call {@link IndexReader#numDeletedDocs} This saves disk space and memory usage while searching. expungeDeletes should be somewhat faster than optimize since it does not insist on reducing the index to a single segment (though, this depends on the {@link MergePolicy}; see {@link MergePolicy#findMergesToExpungeDeletes}.). Note that this call does not first commit any buffered documents, so you must do so yourself if necessary. See also {@link #expungeDeletes(bool)}

public void ExpungeDeletes();

Just like {@link #expungeDeletes()}, except you can specify whether the call should block until the operation completes. This is only meaningful with a {@link MergeScheduler} that is able to run merges in background threads.

public void ExpungeDeletes(bool);

See Also

IndexWriter Class | Lucene.Net.Index Namespace