Code cleanup

This commit is contained in:
Eugene Livis 2020-05-27 10:28:38 -04:00
parent ccd755524f
commit 39dc0c9cd9
6 changed files with 14 additions and 13 deletions

View File

@ -45,7 +45,7 @@
that avoids logging every request that avoids logging every request
--> -->
<schema name="Autopsy Keyword Search" version="2.2"> <schema name="Autopsy Keyword Search" version="2.3">
<!-- attribute "name" is the name of this schema and is only used for display purposes. <!-- attribute "name" is the name of this schema and is only used for display purposes.
Applications should change this to reflect the nature of the search collection. Applications should change this to reflect the nature of the search collection.
version="1.4" is Solr's version number for the schema syntax and semantics. It should version="1.4" is Solr's version number for the schema syntax and semantics. It should

View File

@ -183,7 +183,8 @@ class DropdownToolbar extends javax.swing.JPanel {
} }
else { else {
Index indexInfo = server.getIndexInfo(); Index indexInfo = server.getIndexInfo();
if (IndexFinder.getCurrentSolrVersion().equals(indexInfo.getSolrVersion())) { // ELTODO
// ELTODO if (IndexFinder.getCurrentSolrVersion().equals(indexInfo.getSolrVersion())) {
/* /*
* Solr version is current, so check the Solr * Solr version is current, so check the Solr
* schema version and selectively enable the ad * schema version and selectively enable the ad
@ -194,13 +195,13 @@ class DropdownToolbar extends javax.swing.JPanel {
searchDropButton.setEnabled(true); searchDropButton.setEnabled(true);
dropPanel.setRegexSearchEnabled(schemaIsCompatible); dropPanel.setRegexSearchEnabled(schemaIsCompatible);
active = true; active = true;
} else { /*} ELTODO else {
/* /*
* Unsupported Solr version, disable the ad hoc * Unsupported Solr version, disable the ad hoc
* search UI components. * search UI components.
*/ */
disableSearch = true; // ELTODO disableSearch = true;
} //}
} }
} catch (NoOpenCoreException ex) { } catch (NoOpenCoreException ex) {
/* /*

View File

@ -48,8 +48,8 @@ final class Index {
*/ */
Index(String indexPath, String solrVersion, String schemaVersion, String coreName, String caseName) { Index(String indexPath, String solrVersion, String schemaVersion, String coreName, String caseName) {
this.indexPath = uncPathUtilities.convertPathToUNC(indexPath); this.indexPath = uncPathUtilities.convertPathToUNC(indexPath);
this.solrVersion = "8"; // ELTODO solrVersion; this.solrVersion = solrVersion;
this.schemaVersion = "2.2"; // ELTODO schemaVersion; this.schemaVersion = schemaVersion;
if (coreName == null || coreName.isEmpty()) { if (coreName == null || coreName.isEmpty()) {
// come up with a new core name // come up with a new core name
coreName = createCoreName(caseName); coreName = createCoreName(caseName);

View File

@ -40,7 +40,7 @@ class IndexFinder {
private static final String KWS_DATA_FOLDER_NAME = "data"; private static final String KWS_DATA_FOLDER_NAME = "data";
private static final String INDEX_FOLDER_NAME = "index"; private static final String INDEX_FOLDER_NAME = "index";
private static final String CURRENT_SOLR_VERSION = "8"; private static final String CURRENT_SOLR_VERSION = "8";
private static final String CURRENT_SOLR_SCHEMA_VERSION = "2.2"; private static final String CURRENT_SOLR_SCHEMA_VERSION = "2.3";
static String getCurrentSolrVersion() { static String getCurrentSolrVersion() {
return CURRENT_SOLR_VERSION; return CURRENT_SOLR_VERSION;

View File

@ -546,9 +546,9 @@ public class Server {
} }
void start() throws KeywordSearchModuleException, SolrServerNoPortException { void start() throws KeywordSearchModuleException, SolrServerNoPortException {
startSolr8(); //startSolr8();
//startSolr4(); startSolr4();
//startSolr8(); //startSolr8();

View File

@ -352,7 +352,7 @@ public class SolrSearchService implements KeywordSearchService, AutopsyService {
double currentSolrVersion = NumberUtils.toDouble(IndexFinder.getCurrentSolrVersion()); double currentSolrVersion = NumberUtils.toDouble(IndexFinder.getCurrentSolrVersion());
double indexSolrVersion = NumberUtils.toDouble(indexToUse.getSolrVersion()); double indexSolrVersion = NumberUtils.toDouble(indexToUse.getSolrVersion());
if (indexSolrVersion == currentSolrVersion) { // ELTODO if (indexSolrVersion == currentSolrVersion) {
// latest Solr version but schema not compatible. index should be used in read-only mode // latest Solr version but schema not compatible. index should be used in read-only mode
if (!indexToUse.isCompatible(IndexFinder.getCurrentSchemaVersion()) && RuntimeProperties.runningWithGUI()) { if (!indexToUse.isCompatible(IndexFinder.getCurrentSchemaVersion()) && RuntimeProperties.runningWithGUI()) {
// pop up a message box to indicate the read-only restrictions. // pop up a message box to indicate the read-only restrictions.
@ -374,12 +374,12 @@ public class SolrSearchService implements KeywordSearchService, AutopsyService {
} }
// proceed with case open // proceed with case open
currentVersionIndex = indexToUse; currentVersionIndex = indexToUse;
} else { /* ELTODO } else {
// index needs to be upgraded to latest supported version of Solr // index needs to be upgraded to latest supported version of Solr
// ELTODO REMOVE // ELTODO REMOVE
currentVersionIndex = indexToUse; currentVersionIndex = indexToUse;
// ELTODO REMOVE throw new AutopsyServiceException("Unable to find index to use for Case open"); // ELTODO REMOVE throw new AutopsyServiceException("Unable to find index to use for Case open");
} }*/
} }
} }