Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
Show tags in search results (if activated in ConfigPortal_p.html)
cominch3c255c025b83
diff --git a/defaults/yacy.init b/defaults/yacy.initindex 0026fec69..6cdd6785f 100644--- a/defaults/yacy.init+++ b/defaults/yacy.init@@ -750,6 +750,7 @@ search.result.show.parser = falsesearch.result.show.pictures = falsesearch.result.show.cache = truesearch.result.show.proxy = false+search.result.show.tags = false# search navigators: comma-separated list of default values for search navigation.# can be temporary different if search string is given with differen navigation valuesdiff --git a/htroot/ConfigPortal.html b/htroot/ConfigPortal.htmlindex 4f4ab4c6e..bafdd84d4 100644--- a/htroot/ConfigPortal.html+++ b/htroot/ConfigPortal.html@@ -77,6 +77,7 @@<input type="checkbox" name="search.result.show.pictures" value="true" #(search.result.show.pictures)#::checked="checked"#(/search.result.show.pictures)# />Pictures <input type="checkbox" name="search.result.show.cache" value="true" #(search.result.show.cache)#::checked="checked"#(/search.result.show.cache)# />Cache<input type="checkbox" name="search.result.show.proxy" value="true" #(search.result.show.proxy)#::checked="checked"#(/search.result.show.proxy)# />Augmented Proxy+ <input type="checkbox" name="search.result.show.tags" value="true" #(search.result.show.tags)#::checked="checked"#(/search.result.show.tags)# />Tags</dd><dt>Show Navigation on Side-Bar</dt>diff --git a/htroot/ConfigPortal.java b/htroot/ConfigPortal.javaindex 7b1822334..d2a4d6b03 100644--- a/htroot/ConfigPortal.java+++ b/htroot/ConfigPortal.java@@ -94,6 +94,7 @@ public class ConfigPortal {sb.setConfig("search.result.show.pictures", post.getBoolean("search.result.show.pictures", false));sb.setConfig("search.result.show.cache", post.getBoolean("search.result.show.cache", false));sb.setConfig("search.result.show.proxy", post.getBoolean("search.result.show.proxy", false));+ sb.setConfig("search.result.show.tags", post.getBoolean("search.result.show.tags", false));sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, post.get("search.verify", "ifexist"));sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, post.getBoolean("search.verify.delete", false));@@ -140,6 +141,7 @@ public class ConfigPortal {sb.setConfig("search.result.show.pictures", false);sb.setConfig("search.result.show.cache", true);sb.setConfig("search.result.show.proxy", false);+ sb.setConfig("search.result.show.tags", false);sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, "iffresh");sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, "true");sb.setConfig("about.headline", "");@@ -171,6 +173,7 @@ public class ConfigPortal {prop.put("search.result.show.pictures", sb.getConfigBool("search.result.show.pictures", false) ? 1 : 0);prop.put("search.result.show.cache", sb.getConfigBool("search.result.show.cache", false) ? 1 : 0);prop.put("search.result.show.proxy", sb.getConfigBool("search.result.show.proxy", false) ? 1 : 0);+ prop.put("search.result.show.tags", sb.getConfigBool("search.result.show.tags", false) ? 1 : 0);prop.put("search.navigation.hosts", sb.getConfig("search.navigation", "").indexOf("hosts",0) >= 0 ? 1 : 0);prop.put("search.navigation.authors", sb.getConfig("search.navigation", "").indexOf("authors",0) >= 0 ? 1 : 0);diff --git a/htroot/interaction/Triple.java b/htroot/interaction/Triple.javaindex 67a11f9b6..7d94a0490 100644--- a/htroot/interaction/Triple.java+++ b/htroot/interaction/Triple.java@@ -107,10 +107,18 @@ public class Triple {if(post.containsKey("s")){s = post.get("s");}++ if(post.containsKey("sp")){+ s = post.get("sp") + "#" + s;+ }if(post.containsKey("p")){p = post.get("p");}++ if(post.containsKey("pp")){+ p = post.get("pp") + "#" + p;+ }if(post.containsKey("o")){o = post.get("o");@@ -123,9 +131,9 @@ public class Triple {if (post.containsKey("load")) {if (global) {- o = JenaTripleStore.getObject(s, p).toString();+ o = JenaTripleStore.getObject(s, p);} else {- o = JenaTripleStore.getObject(s, p, username).toString();+ o = JenaTripleStore.getObject(s, p, username);}diff --git a/htroot/interaction_elements/interaction.js b/htroot/interaction_elements/interaction.jsindex e92b992c0..90c6840a6 100644--- a/htroot/interaction_elements/interaction.js+++ b/htroot/interaction_elements/interaction.js@@ -181,3 +181,21 @@ function loadvalueglobal (s, p) {return res.result;}+++function triple_get_prefix (sp, s, pp, p) {++ var res = {result: ""};++ $.ajaxSetup({async: false});++ $.getJSON('/currentyacypeer/interaction/Triple.json?sep=true&global=true&sp='+sp+'&s='+s+'&pp='+pp+'&p='+p+'&load=true', function (data) {++ res = data;++ });+++ return res.result;++}\ No newline at end of filediff --git a/htroot/yacysearch.html b/htroot/yacysearch.htmlindex d1c5fc76d..ff1bd2532 100644--- a/htroot/yacysearch.html+++ b/htroot/yacysearch.html@@ -3,6 +3,7 @@<head><title>#[former]# - YaCy '#[clientname]#': Search Page</title>#%env/templates/metas.template%#+ #%env/templates/interactionheader.template%#<link rel="alternate" type="application/rss+xml" title="Search for #[former]#" href="yacysearch.rss?query=#[former]#" /><link rel="search" type="application/opensearchdescription+xml" title="YaCy Search on '#[clientname]#'" href="http://#[thisaddress]#/opensearchdescription.xml" /><link rel="stylesheet" type="text/css" media="screen" href="/env/highslide.css" />diff --git a/htroot/yacysearchitem.html b/htroot/yacysearchitem.htmlindex f3b5d748d..3eb84c848 100644--- a/htroot/yacysearchitem.html+++ b/htroot/yacysearchitem.html@@ -31,6 +31,7 @@#(showPictures)#:: | <a href="yacysearch.html?cat=image&url=#[link]#&query=#[former]#">Pictures</a>#(/showPictures)##(showCache)#:: | <a href="CacheResource_p.html?url=#[link]#" target="_blank">Cache</a>#(/showCache)##(showProxy)#:: | <a href="proxy.html?url=#[link]#" target="_blank">Augmented Proxy</a>#(/showProxy)#+ #(showTags)#::<br/><!--#include virtual="/currentyacypeer/interaction_elements/Tag_part.html?hash=#[urlhash]#&url=#[url]#" -->#(/showTags)#</p></div>::diff --git a/htroot/yacysearchitem.java b/htroot/yacysearchitem.javaindex 4256754f3..4bb9e50ac 100644--- a/htroot/yacysearchitem.java+++ b/htroot/yacysearchitem.java@@ -130,6 +130,7 @@ public class yacysearchitem {prop.put("content_showPictures", sb.getConfigBool("search.result.show.pictures", true) ? 1 : 0);prop.put("content_showCache", sb.getConfigBool("search.result.show.cache", true) ? 1 : 0);prop.put("content_showProxy", sb.getConfigBool("search.result.show.proxy", true) ? 1 : 0);+ prop.put("content_showTags", sb.getConfigBool("search.result.show.tags", false) ? 1 : 0);prop.put("content_authorized", authenticated ? "1" : "0");final String urlhash = ASCII.String(result.hash());prop.put("content_authorized_bookmark", sb.tables.bookmarks.hasBookmark("admin", urlhash) ? "0" : "1");@@ -189,6 +190,7 @@ public class yacysearchitem {prop.put("content_showCache_link", resultUrlstring);prop.put("content_showProxy_link", resultUrlstring);prop.put("content_showParser_urlhash", resulthashString);+ prop.put("content_showTags_urlhash", resulthashString);prop.put("content_urlhexhash", Seed.b64Hash2hexHash(resulthashString));prop.putHTML("content_urlname", nxTools.shortenURLString(result.urlname(), MAX_URL_LENGTH));prop.put("content_showDate_date", GenericFormatter.RFC1123_SHORT_FORMATTER.format(result.modified()));diff --git a/source/net/yacy/cora/lod/JenaTripleStore.java b/source/net/yacy/cora/lod/JenaTripleStore.javaindex 5a040b819..0be297f33 100644--- a/source/net/yacy/cora/lod/JenaTripleStore.java+++ b/source/net/yacy/cora/lod/JenaTripleStore.java@@ -199,35 +199,27 @@ public class JenaTripleStore {}public static String getObject (final String subject, final String predicate) {-- Iterator<RDFNode> iter = getObjects (subject, predicate);-- while (iter.hasNext()) {-- return (iter.next().toString());-- }++ Log.logInfo("TRIPLESTORE", "GET " + subject + " - " + predicate + " ... ");- return null;+ Iterator<RDFNode> ni = JenaTripleStore.getObjects (subject, predicate);+ if (!ni.hasNext()) return "";+ return ni.next().toString();}public static String getObject (final String subject, final String predicate, final String username) {- Iterator<RDFNode> iter = getObjects (subject, predicate, username);-- while (iter.hasNext()) {-- return (iter.next().toString());-- }+ Log.logInfo("TRIPLESTORE", "GET " + subject + " - " + predicate + " ... ("+username+")");- return null;+ Iterator<RDFNode> ni = JenaTripleStore.getObjects (subject, predicate, username);+ if (!ni.hasNext()) return "";+ return ni.next().toString();}public static Iterator<RDFNode> getObjects(final String subject, final String predicate, final String username) {- Log.logInfo("TRIPLESTORE", "GET " + subject + " - " + predicate + " ... ");+final Resource r = JenaTripleStore.getResource(subject, username);if (privatestorage != null && privatestorage.containsKey(username)) {@@ -238,8 +230,7 @@ public class JenaTripleStore {return null;}- public static Iterator<RDFNode> getObjects(final String subject, final String predicate) {- Log.logInfo("TRIPLESTORE", "GET " + subject + " - " + predicate + " ... ");+ public static Iterator<RDFNode> getObjects(final String subject, final String predicate) {final Resource r = JenaTripleStore.getResource(subject);return getObjects(r, predicate);}@@ -250,7 +241,8 @@ public class JenaTripleStore {public static Iterator<RDFNode> getObjects(final Resource r, final String predicate, final Model model) {final Property pr = JenaTripleStore.getProperty(predicate, model);- final StmtIterator iter = model.listStatements(r, pr, (Resource) null);+ final StmtIterator iter = model.listStatements(r, pr, (Resource) null);+return new Iterator<RDFNode>() {@Overridepublic boolean hasNext() {