Add ssh command to activate the latest index
In case the online indexer fails, this allows the admins to activate the latest index. Change-Id: I59ebf2bce02a599b87d0f7771fc806ff64a3ba64
This commit is contained in:
@@ -182,6 +182,22 @@ public class LuceneVersionManager implements LifecycleListener {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate the latest index if the current index is not already the latest.
|
||||
*
|
||||
* @return true if index was activate, otherwise false.
|
||||
* @throws ReindexerAlreadyRunningException
|
||||
*/
|
||||
public synchronized boolean activateLatestIndex()
|
||||
throws ReindexerAlreadyRunningException {
|
||||
validateReindexerNotRunning();
|
||||
if (!isCurrentIndexVersionLatest()) {
|
||||
reindexer.activateIndex();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isCurrentIndexVersionLatest() {
|
||||
return reindexer == null
|
||||
|| reindexer.getVersion() == indexes.getSearchIndex().getSchema()
|
||||
|
Reference in New Issue
Block a user