Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
fixes for searches when initialization of large autotagging libraries have not been finished
Michael Peter Christend3e71ed07038
diff --git a/htroot/ViewImage.java b/htroot/ViewImage.javaindex 42b40b55b..d96545572 100644--- a/htroot/ViewImage.java+++ b/htroot/ViewImage.java@@ -46,6 +46,7 @@ import net.yacy.document.ImageParser;import net.yacy.kelondro.util.FileUtils;import net.yacy.kelondro.util.MemoryControl;import net.yacy.kelondro.workflow.WorkflowProcessor;+import net.yacy.peers.graphics.EncodedImage;import net.yacy.repository.Blacklist.BlacklistType;import net.yacy.search.Switchboard;import net.yacy.server.serverObjects;@@ -63,7 +64,7 @@ public class ViewImage {}}- public static Image respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {+ public static Object respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {final Switchboard sb = (Switchboard)env;@@ -73,6 +74,8 @@ public class ViewImage {String urlString = post.get("url", "");final String urlLicense = post.get("code", "");+ boolean isStatic = post.getBoolean("isStatic");+ String ext = header.get("EXT", null);final boolean quadratic = post.containsKey("quadratic");final boolean auth = Domains.isLocalhost(header.get(HeaderFramework.CONNECTION_PROP_CLIENTIP, "")) || sb.verifyAuthentication(header); // handle access rights@@ -144,7 +147,7 @@ public class ViewImage {// read imageimage = ImageParser.parse(urlString, imgb);- if (image == null || (auth && (width == 0 || height == 0) && maxwidth == 0 && maxheight == 0)) return image;+ if (image == null || (auth && (width == 0 || height == 0) && maxwidth == 0 && maxheight == 0)) return ext == null ? image : new EncodedImage(image, ext, isStatic);// find original sizefinal int h = image.getHeight(null);@@ -229,7 +232,7 @@ public class ViewImage {}}- return image;+ return ext == null ? image : new EncodedImage(image, ext, isStatic);}}diff --git a/htroot/yacysearch.java b/htroot/yacysearch.javaindex 445cb7137..a9c5d5384 100644--- a/htroot/yacysearch.java+++ b/htroot/yacysearch.java@@ -127,7 +127,7 @@ public class yacysearch {prop.put("topmenu", sb.getConfigBool("publicTopmenu", true) ? 1 : 0);// produce vocabulary navigation sidebars- Collection<Tagging> vocabularies = LibraryProvider.autotagging.getVocabularies();+ Collection<Tagging> vocabularies = LibraryProvider.autotagging == null ? new ArrayList<Tagging>(0) : LibraryProvider.autotagging.getVocabularies();int j = 0;for (Tagging v: vocabularies) {prop.put("sidebarVocabulary_" + j + "_vocabulary", v.getName());diff --git a/source/net/yacy/search/query/QueryParams.java b/source/net/yacy/search/query/QueryParams.javaindex 4df5f9323..8eb371af3 100644--- a/source/net/yacy/search/query/QueryParams.java+++ b/source/net/yacy/search/query/QueryParams.java@@ -230,7 +230,7 @@ public final class QueryParams {// handle special field, authors_sxt (add to facet w/o contains check, as authors_sxt is not enabled (is copyfield))if (f != null && (solrSchema.contains(f) || f.name().equals("author_sxt"))) this.facetfields.add(f.getSolrFieldName());}- for (Tagging v: LibraryProvider.autotagging.getVocabularies()) {+ if (LibraryProvider.autotagging != null) for (Tagging v: LibraryProvider.autotagging.getVocabularies()) {if (v.isFacet()) {this.facetfields.add(CollectionSchema.VOCABULARY_PREFIX + v.getName() + CollectionSchema.VOCABULARY_TERMS_SUFFIX);}