CheckSegments

Index.CheckSegments method

Checks the index files for damage. The method repairs the index if fixIndexFunctionality is true; otherwise, it only reports the damage found.

public void CheckSegments(bool fixIndexFunctionality)
Parameter Type Description
fixIndexFunctionality Boolean The index functionality fix flag.

Exceptions

exception condition
ObjectDisposedException The index is disposed.

Remarks

Every damage found and every repair made is reported through the ErrorOccurred event. The repair keeps documents whenever possible: the documents of a segment or a text that cannot be restored are deleted from the index, so that the next update indexes their files again. The event names every deleted document by its key: a document added from a stream or a structure is not indexed again by an update, so it has to be added again. A file that cannot be read for a reason other than damage, for example because another process has locked it, is not taken for a damaged file: the check stops, the reason is reported, and nothing is repaired. So is a file that a newer version of the library has written.

See Also