Method ListCommits
ListCommits(Directory)
Returns all commit points that exist in the Directory. Normally, because the default is KeepOnlyLastCommitDeletionPolicy, there would be only one commit point. But if you're using a custom IndexDeletionPolicy then there could be many commits. Once you have a given commit, you can open a reader on it by calling Open(IndexCommit) There must be at least one commit in the Directory, else this method throws IndexNotFoundException. Note that if a commit is in progress while this method is running, that commit may or may not be returned.
Declaration
public static IList<IndexCommit> ListCommits(Directory dir)
Parameters
Type | Name | Description |
---|---|---|
Directory | dir |
Returns
Type | Description |
---|---|
IList<IndexCommit> | a sorted list of IndexCommits, from oldest to latest. |