Expert: policy for deletion of stale {@link IndexCommit index commits}.
Implement this interface, and pass it to one
of the {@link IndexWriter} or {@link IndexReader}
constructors, to customize when older
{@link IndexCommit point-in-time commits}
are deleted from the index directory. The default deletion policy
is {@link KeepOnlyLastCommitDeletionPolicy}, which always
removes old commits as soon as a new commit is done (this
matches the behavior before 2.2).
One expected use case for this (and the reason why it
was first created) is to work around problems with an
index directory accessed via filesystems like NFS because
NFS does not provide the "delete on last close" semantics
that Lucene's "point in time" search normally relies on.
By implementing a custom deletion policy, such as "a
commit is only removed once it has been stale for more
than X minutes", you can give your readers time to
refresh to the new commit before {@link IndexWriter}
removes the old commits. Note that doing so will
increase the storage requirements of the index. See
LUCENE-710
for details.
Namespace: Lucene.Net.IndexAssembly: Lucene.Net (in Lucene.Net.dll) Version: 2.9.4.1
Syntax
C# |
---|
public interface IndexDeletionPolicy |
Visual Basic |
---|
Public Interface IndexDeletionPolicy |
Visual C++ |
---|
public interface class IndexDeletionPolicy |
See Also