Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

Add preference (disabled by default) to show the ranking for each result on the HTML UI.

JeremyRand4963ecb0a0c6
diff --git a/defaults/yacy.init b/defaults/yacy.init
index 9af84efaf..9db82040d 100644
--- a/defaults/yacy.init
+++ b/defaults/yacy.init
@@ -849,6 +849,7 @@ search.result.show.hostbrowser = true
search.result.show.vocabulary = false
search.result.show.vocabulary.omit =
search.result.show.snapshots = false
+search.result.show.ranking = false
# search navigators: comma-separated list of default values for search navigation.
diff --git a/htroot/yacysearchitem.html b/htroot/yacysearchitem.html
index ba2b82447..e605392b3 100644
--- a/htroot/yacysearchitem.html
+++ b/htroot/yacysearchitem.html
@@ -36,6 +36,7 @@
#(showHostBrowser)#::&nbsp;|&nbsp;<a href="HostBrowser.html?path=#[link]#"><img src="env/grafics/minitree.png" width="15" height="8" title="Browse index" alt="Browse index"/></a>#(/showHostBrowser)#
#(showVocabulary)#::<br/>#{vocabulary}##[name]#:#[terms]# #{/vocabulary}##(/showVocabulary)#
#(showSnapshots)#::<a href="#[link]#">Snapshots</a>#(/showSnapshots)#
+ #(showRanking)#::&nbsp;|&nbsp;Ranking: #[ranking]##(/showRanking)#
</p>
</div>
::
diff --git a/htroot/yacysearchitem.java b/htroot/yacysearchitem.java
index ea1b4c84a..41098268f 100644
--- a/htroot/yacysearchitem.java
+++ b/htroot/yacysearchitem.java
@@ -213,6 +213,7 @@ public class yacysearchitem {
prop.put("content_showHostBrowser", sb.getConfigBool("search.result.show.hostbrowser", true) ? 1 : 0);
prop.put("content_showSnapshots", snapshotPaths != null && snapshotPaths.size() > 0 && sb.getConfigBool("search.result.show.snapshots", true) ? 1 : 0);
prop.put("content_showVocabulary", sb.getConfigBool("search.result.show.vocabulary", true) ? 1 : 0);
+ prop.put("content_showRanking", sb.getConfigBool("search.result.show.ranking", false) ? 1 : 0);
if (showEvent) prop.put("content_showEvent_date", GenericFormatter.RFC1123_SHORT_FORMATTER.format(events[0]));
prop.put("content_showDate_date", GenericFormatter.RFC1123_SHORT_FORMATTER.format(result.moddate()));
@@ -243,6 +244,7 @@ public class yacysearchitem {
if (snapshotPaths != null && snapshotPaths.size() > 0) {
prop.put("content_showSnapshots_link", snapshotPaths.iterator().next().getAbsolutePath());
}
+ prop.put("content_showRanking_ranking", Float.toString(result.score()));
}
prop.put("content_urlhexhash", Seed.b64Hash2hexHash(urlhash));
prop.putHTML("content_urlname", nxTools.shortenURLString(result.urlname(), MAX_URL_LENGTH));