diff --git a/defaults/yacy.init b/defaults/yacy.init index 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 directory surrogates.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 releases releases = DATA/RELEASE diff --git a/source/de/anomic/search/SearchEvent.java b/source/de/anomic/search/SearchEvent.java index 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.java index 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 management public 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 serverSwi RemoteProxyConfig.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 serverSwi this.rankingPermissions = new HashMap(); // 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 libraries this.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 automatically final int wordCacheMaxCount = (int) getConfigLong(SwitchboardConstants.WORDCACHE_MAX_COUNT, 20000); @@ -337,8 +340,8 @@ public final class Switchboard extends serverAbstractSwitch implements serverSwi final 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 serverSwi partitionExponent); 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.java index 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"; + /** *

public static final String HTDOCS_PATH = "htDocsPath"

*

Name of the setting specifying the folder beginning from the YaCy-installation's top-folder, where all