Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
added a size field to the search results. The file size is now shown in the html search page and the yacyinteractive. The field is presen in the rss and json
orbiter7cfab2ee9a18
diff --git a/htroot/yacyinteractive.html b/htroot/yacyinteractive.htmlindex 60d61f23e..a84e77543 100644--- a/htroot/yacyinteractive.html+++ b/htroot/yacyinteractive.html@@ -54,11 +54,13 @@ function updatepage(str) {html += "<table class=\"networkTable\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\" width=\"99%\">";html += "<tr class=\"TableHeader\" valign=\"bottom\">";html += "<td width=\"30%\">Name</td>";+ html += "<td width=\"60\">Size</td>";//html += "<td>Description</td>";html += "<td>Link</td></tr>";for (var i = 0; i < firstChannel.items.length; i++) {item = firstChannel.items[i];html += "<tr class=\"TableCellLight\"><td>"+ item.title + "</td>";+ html += "<td align=\"right\">" + item.sizename + "</td>";//html += "<td>" + item.description + "</td>";html += "<td><a href=\"" + item.link + "\">" + item.link + "</a></td></tr>";}diff --git a/htroot/yacysearchitem.html b/htroot/yacysearchitem.htmlindex e0094d28d..b51776512 100644--- a/htroot/yacysearchitem.html+++ b/htroot/yacysearchitem.html@@ -17,7 +17,7 @@#(/authorized)#<p class="snippet"><span class="snippetLoaded" id="h#[urlhash]#">#[description]#</span></p><p class="url"><a href="#[link]#" id="url#[urlhash]#">#[urlname]#</a></p>- <p class="urlinfo">#[date]# | YBR-#[ybr]# | <a href="ViewFile.html?urlHash=#[urlhash]#&words=#[words]#&display=#[display]#">Info</a> | <a href="yacysearch.html?cat=image&url=#[link]#&search=#[former]#&display=#[display]#">Pictures</a></p>+ <p class="urlinfo">#[date]# | #[sizename]# | YBR-#[ybr]# | <a href="ViewFile.html?urlHash=#[urlhash]#&words=#[words]#&display=#[display]#">Info</a> | <a href="yacysearch.html?cat=image&url=#[link]#&search=#[former]#&display=#[display]#">Pictures</a></p></div>::#{items}#diff --git a/htroot/yacysearchitem.java b/htroot/yacysearchitem.javaindex 3ea613302..61eeba2ee 100644--- a/htroot/yacysearchitem.java+++ b/htroot/yacysearchitem.java@@ -125,6 +125,7 @@ public class yacysearchitem {prop.put("content_date822", plasmaSwitchboard.dateString822(result.modified()));prop.put("content_ybr", plasmaSearchRankingProcess.ybr(result.hash()));prop.putNum("content_size", result.filesize());+ prop.putHTML("content_sizename", sizename(result.filesize()));prop.put("content_nl", (item == 0) ? 0 : 1);final TreeSet<String>[] query = theQuery.queryWords();@@ -204,5 +205,15 @@ public class yacysearchitem {if (p < 0) return s.substring(0, length - 3) + "...";return s.substring(0, length - (s.length() - p) - 3) + "..." + s.substring(p);}++ private static String sizename(int size) {+ if (size < 1024) return size + " bytes";+ size = size / 1024;+ if (size < 1024) return size + " kbyte";+ size = size / 1024;+ if (size < 1024) return size + " mbyte";+ size = size / 1024;+ return size + " gbyte";+ }}diff --git a/htroot/yacysearchitem.json b/htroot/yacysearchitem.jsonindex 68023eb16..a72a91891 100644--- a/htroot/yacysearchitem.json+++ b/htroot/yacysearchitem.json@@ -4,5 +4,7 @@"link": "#[link]#","description": "#[description]#","pubDate": "#[date822]#",+ "size": "#[size]#",+ "sizename": "#[sizename]#","guid": "#[urlhash]#"}#(/content)#\ No newline at end of filediff --git a/htroot/yacysearchitem.xml b/htroot/yacysearchitem.xmlindex 2387fe732..d013a0b34 100644--- a/htroot/yacysearchitem.xml+++ b/htroot/yacysearchitem.xml@@ -3,5 +3,7 @@<link>#[link]#</link><description>#[description-xml]#</description><pubDate>#[date822]#</pubDate>+<yacy:size>#[size]#</yacy:size>+<yacy:sizename>#[sizename]#</yacy:sizename><guid isPermaLink="false">#[urlhash]#</guid></item>#(/content)#\ No newline at end of file