#2624 check if index exists
This commit is contained in:
parent
0a51cfb8fc
commit
aaa1ff133c
1 changed files with 7 additions and 2 deletions
|
@ -592,13 +592,18 @@ public class AdminUpgradeAction extends FessAdminAction {
|
|||
final SearchEngineClient client = ComponentUtil.getSearchEngineClient();
|
||||
for (final String index : configIndices) {
|
||||
final String oldIndex = "." + index;
|
||||
if (client.existsIndex(oldIndex)) {
|
||||
if (client.existsIndex(oldIndex) && client.existsIndex(index)) {
|
||||
logger.info("Copying from {} to {}", oldIndex, index);
|
||||
if (!client.reindex(oldIndex, index, false)) {
|
||||
logger.warn("Failed to copy from {} to {}", oldIndex, index);
|
||||
}
|
||||
} else if (logger.isDebugEnabled()) {
|
||||
logger.debug("{} does not exist.", oldIndex);
|
||||
if (!client.existsIndex(oldIndex)) {
|
||||
logger.debug("{} does not exist.", oldIndex);
|
||||
}
|
||||
if (!client.existsIndex(index)) {
|
||||
logger.debug("{} does not exist.", index);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (final String index : crawlerIndices) {
|
||||
|
|
Loading…
Add table
Reference in a new issue