This is called each time the writer completed a commit. This gives the policy a chance to remove old commit points with each commit.

The policy may now choose to delete old commit points by calling method {@link IndexCommit#delete delete()} of {@link IndexCommit}.

If writer has

CopyC#
autoCommit = true
then this method will in general be called many times during one instance of {@link IndexWriter}. If
CopyC#
autoCommit = false
then this method is only called once when {@link IndexWriter#close} is called, or not at all if the {@link IndexWriter#abort} is called.

Note: the last CommitPoint is the most recent one, i.e. the "front index state". Be careful not to delete it, unless you know for sure what you are doing, and unless you can afford to lose the index content while doing that.

Namespace: Lucene.Net.Index
Assembly: Lucene.Net (in Lucene.Net.dll) Version: 2.9.4.1

Syntax

C#
void OnCommit(
	IList commits
)
Visual Basic
Sub OnCommit ( _
	commits As IList _
)
Visual C++
void OnCommit(
	IList^ commits
)

Parameters

commits
Type: System.Collections..::..IList
List of {@link IndexCommit}, sorted by age (the 0th one is the oldest commit).

See Also