IndexUpdater

Inheritance: java.lang.Object

public class IndexUpdater

Represents an index updater. This class performs reindexing documents in an index of an old version.

Learn more

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)) {
     int result = updater.updateVersion(sourceIndexFolder, targetIndexFolder);
 }
 

Constructors

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

Methods

Method Description
isLatestVersion(String indexPath) Checks whether the specified directory contains an index of the latest version.
canUpdateVersion(String indexPath) Checks whether an index in the specified directory can be updated to the latest version.
updateVersion(String indexPath, String newIndexPath) Performs reindexing documents in an index of an old version.

IndexUpdater()

public IndexUpdater()

Initializes a new instance of the IndexUpdater class.

isLatestVersion(String indexPath)

public final boolean isLatestVersion(String indexPath)

Checks whether the specified directory contains an index of the latest version.

Parameters:

Parameter Type Description
indexPath java.lang.String The index directory path.

Returns: boolean - true if the specified directory contains an index of the latest version; otherwise false .

canUpdateVersion(String indexPath)

public final boolean canUpdateVersion(String indexPath)

Checks whether an index in the specified directory can be updated to the latest version.

Parameters:

Parameter Type Description
indexPath java.lang.String The index directory path.

Returns: boolean - true if an index in the specified directory can be updated to the latest version; otherwise false .

updateVersion(String indexPath, String newIndexPath)

public final VersionUpdateResult updateVersion(String indexPath, String newIndexPath)

Performs reindexing documents in an index of an old version. The updated index will be placed in the newIndexPath directory. The index in the indexPath directory will not be changed.

Parameters:

Parameter Type Description
indexPath java.lang.String The index directory path.
newIndexPath java.lang.String The directory for the updated index.

Returns: VersionUpdateResult - The result of the index version update operation.