Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
fix for bad paths in dictionary processing
orbiterd656a94f550a
diff --git a/defaults/yacy.init b/defaults/yacy.initindex f57a696ff..a943c1160 100644--- a/defaults/yacy.init+++ b/defaults/yacy.init@@ -236,6 +236,10 @@ surrogates.in = DATA/SURROGATES/in# a path to the surrogate output directorysurrogates.out = DATA/SURROGATES/out+# a path to the dictionaries directory+# this directory also contains subdirectories for input sources, the did-you-mean function and other+dictionaries = DATA/DICTIONARIES+# storage place for new releasesreleases = DATA/RELEASEdiff --git a/source/de/anomic/search/SearchEvent.java b/source/de/anomic/search/SearchEvent.javaindex 9054e7ba0..7421aee8e 100644--- a/source/de/anomic/search/SearchEvent.java+++ b/source/de/anomic/search/SearchEvent.java@@ -265,17 +265,6 @@ public final class SearchEvent {return false;}- private int countFinishedRemoteSearch() {- int count = 0;- // check only primary search threads- if ((this.primarySearchThreads != null) && (this.primarySearchThreads.length != 0)) {- for (int i = 0; i < this.primarySearchThreads.length; i++) {- if ((this.primarySearchThreads[i] == null) || (!(this.primarySearchThreads[i].isAlive()))) count++;- }- }- return count;- }-public yacySearch[] getPrimarySearchThreads() {return primarySearchThreads;}diff --git a/source/de/anomic/search/Switchboard.java b/source/de/anomic/search/Switchboard.javaindex 6b64a8682..162143c15 100644--- a/source/de/anomic/search/Switchboard.java+++ b/source/de/anomic/search/Switchboard.java@@ -220,6 +220,7 @@ public final class Switchboard extends serverAbstractSwitch implements serverSwi// storage managementpublic File htCachePath;+ public File dictionariesPath;public File listsPath;public File htDocsPath;public File rankingPath;@@ -303,8 +304,8 @@ public final class Switchboard extends serverAbstractSwitch implements serverSwiRemoteProxyConfig.init(this);// load values from configs- final File indexPrimaryPath = getConfigPath(SwitchboardConstants.INDEX_PRIMARY_PATH, SwitchboardConstants.INDEX_PATH_DEFAULT);- this.log.logConfig("Index Primary Path: " + indexPrimaryPath.toString());+ final File indexPath = getConfigPath(SwitchboardConstants.INDEX_PRIMARY_PATH, SwitchboardConstants.INDEX_PATH_DEFAULT);+ this.log.logConfig("Index Primary Path: " + indexPath.toString());this.listsPath = getConfigPath(SwitchboardConstants.LISTS_PATH, SwitchboardConstants.LISTS_PATH_DEFAULT);this.log.logConfig("Lists Path: " + this.listsPath.toString());this.htDocsPath = getConfigPath(SwitchboardConstants.HTDOCS_PATH, SwitchboardConstants.HTDOCS_PATH_DEFAULT);@@ -314,10 +315,12 @@ public final class Switchboard extends serverAbstractSwitch implements serverSwithis.rankingPermissions = new HashMap<String, String>(); // mapping of permission - to filename.this.workPath = getConfigPath(SwitchboardConstants.WORK_PATH, SwitchboardConstants.WORK_PATH_DEFAULT);this.log.logConfig("Work Path: " + this.workPath.toString());+ this.dictionariesPath = getConfigPath(SwitchboardConstants.DICTIONARY_SOURCE_PATH, SwitchboardConstants.DICTIONARY_SOURCE_PATH_DEFAULT);+ this.log.logConfig("Dictionaries Path:" + this.dictionariesPath.toString());// init librariesthis.log.logConfig("initializing libraries");- LibraryProvider.initialize(rootPath, new File(rootPath, "dictionaries"));+ LibraryProvider.initialize(rootPath, this.dictionariesPath);// set a high maximum cache size to current size; this is adopted later automaticallyfinal int wordCacheMaxCount = (int) getConfigLong(SwitchboardConstants.WORDCACHE_MAX_COUNT, 20000);@@ -337,8 +340,8 @@ public final class Switchboard extends serverAbstractSwitch implements serverSwifinal long fileSizeMax = (serverSystem.isWindows) ? sb.getConfigLong("filesize.max.win", (long) Integer.MAX_VALUE) : sb.getConfigLong("filesize.max.other", (long) Integer.MAX_VALUE);final int redundancy = (int) sb.getConfigLong("network.unit.dhtredundancy.senior", 1);final int partitionExponent = (int) sb.getConfigLong("network.unit.dht.partitionExponent", 0);- this.networkRoot = new File(new File(indexPrimaryPath, networkName), "NETWORK");- this.queuesRoot = new File(new File(indexPrimaryPath, networkName), "QUEUES");+ this.networkRoot = new File(new File(indexPath, networkName), "NETWORK");+ this.queuesRoot = new File(new File(indexPath, networkName), "QUEUES");this.networkRoot.mkdirs();this.queuesRoot.mkdirs();try {@@ -353,7 +356,7 @@ public final class Switchboard extends serverAbstractSwitch implements serverSwipartitionExponent);indexSegment = new Segment(log,- new File(new File(indexPrimaryPath, networkName), "TEXT"),+ new File(new File(indexPath, networkName), "TEXT"),wordCacheMaxCount,fileSizeMax);crawler = new CrawlSwitchboard(diff --git a/source/de/anomic/search/SwitchboardConstants.java b/source/de/anomic/search/SwitchboardConstants.javaindex f10df8070..597bb92ef 100644--- a/source/de/anomic/search/SwitchboardConstants.java+++ b/source/de/anomic/search/SwitchboardConstants.java@@ -332,6 +332,9 @@ public final class SwitchboardConstants {public static final String SURROGATES_OUT_PATH = "surrogates.out";public static final String SURROGATES_OUT_PATH_DEFAULT = "DATA/SURROGATES/out";+ public static final String DICTIONARY_SOURCE_PATH = "dictionaries";+ public static final String DICTIONARY_SOURCE_PATH_DEFAULT = "DATA/DICTIONARIES";+/*** <p><code>public static final String <strong>HTDOCS_PATH</strong> = "htDocsPath"</code></p>* <p>Name of the setting specifying the folder beginning from the YaCy-installation's top-folder, where all