Bug fix for SU mode

This commit is contained in:
Eugene Livis 2020-07-17 16:56:06 -04:00
parent 58178a8192
commit 67817c4b98

View File

@ -1062,23 +1062,25 @@ public class Server {
} }
} }
} else { } else {
// In single user mode, the index is stored in case output directory if (!coreIsLoaded(collectionName)) {
File dataDir = new File(new File(index.getIndexPath()).getParent()); // "data dir" is the parent of the index directory // In single user mode, the index is stored in case output directory
if (!dataDir.exists()) { File dataDir = new File(new File(index.getIndexPath()).getParent()); // "data dir" is the parent of the index directory
dataDir.mkdirs(); if (!dataDir.exists()) {
} dataDir.mkdirs();
}
// for single user cases, we unload the core when we close the case. So we have to load the core again. // for single user cases, we unload the core when we close the case. So we have to load the core again.
CoreAdminRequest.Create createCoreRequest = new CoreAdminRequest.Create(); CoreAdminRequest.Create createCoreRequest = new CoreAdminRequest.Create();
createCoreRequest.setDataDir(dataDir.getAbsolutePath()); createCoreRequest.setDataDir(dataDir.getAbsolutePath());
createCoreRequest.setCoreName(collectionName); createCoreRequest.setCoreName(collectionName);
createCoreRequest.setConfigSet("AutopsyConfig"); //NON-NLS createCoreRequest.setConfigSet("AutopsyConfig"); //NON-NLS
createCoreRequest.setIsLoadOnStartup(false); createCoreRequest.setIsLoadOnStartup(false);
createCoreRequest.setIsTransient(true); createCoreRequest.setIsTransient(true);
localSolrServer.request(createCoreRequest); localSolrServer.request(createCoreRequest);
if (!coreIndexFolderExists(collectionName)) { if (!coreIndexFolderExists(collectionName)) {
throw new KeywordSearchModuleException(NbBundle.getMessage(this.getClass(), "Server.openCore.exception.noIndexDir.msg")); throw new KeywordSearchModuleException(NbBundle.getMessage(this.getClass(), "Server.openCore.exception.noIndexDir.msg"));
}
} }
} }