From 4963ecb0a0c672ce7bb62b2910194d2e80dd06fe Mon Sep 17 00:00:00 2001 From: JeremyRand Date: Tue, 4 Oct 2016 11:49:16 +0000 Subject: [PATCH] Add preference (disabled by default) to show the ranking for each result on the HTML UI. --- defaults/yacy.init | 1 + htroot/yacysearchitem.html | 1 + htroot/yacysearchitem.java | 2 ++ 3 files changed, 4 insertions(+) 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)#:: | Browse index#(/showHostBrowser)# #(showVocabulary)#::
#{vocabulary}##[name]#:#[terms]# #{/vocabulary}##(/showVocabulary)# #(showSnapshots)#::Snapshots#(/showSnapshots)# + #(showRanking)#:: | Ranking: #[ranking]##(/showRanking)#

:: 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));