Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
show vocabularies in search result (in case of debugging)
Michael Peter Christen3c71e1c8728c
diff --git a/htroot/yacysearchitem.html b/htroot/yacysearchitem.htmlindex 02dc19718..5d2d1d80e 100644--- a/htroot/yacysearchitem.html+++ b/htroot/yacysearchitem.html@@ -33,6 +33,7 @@#(showCache)#:: | <a href="CacheResource_p.html?url=#[link]#" target="_blank">Cache</a>#(/showCache)##(showProxy)#:: | <a href="proxy.html?url=#[link]#" target="_blank">Augmented Browsing</a>#(/showProxy)##(showHostBrowser)#:: | <a href="HostBrowser.html?path=#[link]#"><img src="env/grafics/minitree.png" width="15" height="8"/></a>#(/showHostBrowser)#+ #(showVocabulary)#::<br/>#{vocabulary}##[name]#:#[terms]# #{/vocabulary}##(/showVocabulary)#</p></div>::diff --git a/htroot/yacysearchitem.java b/htroot/yacysearchitem.javaindex 41f6ec764..9965e9e1e 100644--- a/htroot/yacysearchitem.java+++ b/htroot/yacysearchitem.java@@ -25,7 +25,9 @@// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USAimport java.net.MalformedURLException;+import java.util.Collection;import java.util.Iterator;+import java.util.Map;import net.yacy.cora.date.GenericFormatter;import net.yacy.cora.date.ISO8601Formatter;@@ -42,6 +44,7 @@ import net.yacy.cora.util.ConcurrentLog;import net.yacy.cora.util.Memory;import net.yacy.crawler.data.Cache;import net.yacy.data.URLLicense;+import net.yacy.kelondro.data.meta.URIMetadataNode;import net.yacy.kelondro.util.Formatter;import net.yacy.peers.NewsPool;import net.yacy.peers.Seed;@@ -194,6 +197,7 @@ public class yacysearchitem {prop.put("content_showCache", sb.getConfigBool("search.result.show.cache", true) && Cache.has(resultURL.hash()) ? 1 : 0);prop.put("content_showProxy", sb.getConfigBool("search.result.show.proxy", true) ? 1 : 0);prop.put("content_showHostBrowser", sb.getConfigBool("search.result.show.hostbrowser", true) ? 1 : 0);+ prop.put("content_showVocabulary", sb.getConfigBool("search.result.show.vocabulary", true) ? 1 : 0);prop.put("content_showDate_date", GenericFormatter.RFC1123_SHORT_FORMATTER.format(result.modified()));prop.putHTML("content_showSize_sizename", RSSMessage.sizename(result.filesize()));@@ -204,6 +208,25 @@ public class yacysearchitem {prop.put("content_showCache_link", resultUrlstring);prop.put("content_showProxy_link", resultUrlstring);prop.put("content_showHostBrowser_link", resultUrlstring);+ if (sb.getConfigBool("search.result.show.vocabulary", true)) {+ URIMetadataNode node = result.getNode();+ int c = 0;+ for (Map.Entry<String, Object> entry: node.entrySet()) {+ String key = entry.getKey();+ if (key.startsWith("vocabulary_") && key.endsWith("_sxt")) {+ @SuppressWarnings("unchecked")+ Collection<String> terms = (Collection<String>) entry.getValue();+ prop.putHTML("content_showVocabulary_vocabulary_" + c + "_name", key.substring(11, key.length() - 4));+ prop.putHTML("content_showVocabulary_vocabulary_" + c + "_terms", terms.toString());+ c++;+ }+ }+ prop.put("content_showVocabulary_vocabulary", c);+ prop.put("content_showVocabulary", 1);+ } else {+ prop.put("content_showVocabulary_vocabulary", 0);+ prop.put("content_showVocabulary", 0);+ }}prop.put("content_urlhexhash", Seed.b64Hash2hexHash(urlhash));prop.putHTML("content_urlname", nxTools.shortenURLString(result.urlname(), MAX_URL_LENGTH));