IndexUpdater

IndexUpdater class

Represents an index updater. This class updates an index of an old version to the latest version. Depending on the old version, the data of the index are converted or its documents are indexed again.

public class IndexUpdater

Constructors

Name Description
IndexUpdater() Initializes a new instance of the IndexUpdater class.

Methods

Name Description
CanUpdateVersion(string) Checks whether an index in the specified directory can be updated to the latest version.
IsLatestVersion(string) Checks whether the specified directory contains an index of the latest version.
UpdateVersion(string, string) Updates an index of an old version to the latest version. Depending on the old version, the data of the index are converted or its documents are indexed again; in the latter case the documents must be available at the paths from which they were indexed. The updated index will be placed in the newIndexPath directory. The index in the indexPath directory will not be changed.

Remarks

Learn more

Examples

The example demonstrates a typical usage of the class.

string sourceIndexFolder = @"c:\MyOldIndex\";
string targetIndexFolder = @"c:\MyNewIndex\";

IndexUpdater updater = new IndexUpdater();

if (updater.CanUpdateVersion(sourceIndexFolder))
{
    VersionUpdateResult result = updater.UpdateVersion(sourceIndexFolder, targetIndexFolder);
}

See Also