Skip to content

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

Improved previous merge "Show ranking in HTML UI".

lucciomand90b001e1b09
diff --git a/defaults/yacy.init b/defaults/yacy.init
index 7df8f95a8..23e323805 100644
--- a/defaults/yacy.init
+++ b/defaults/yacy.init
@@ -863,6 +863,7 @@ search.result.show.hostbrowser = true
search.result.show.vocabulary = false
search.result.show.vocabulary.omit =
search.result.show.snapshots = false
+# when true, display the raw ranking score value
search.result.show.ranking = false
diff --git a/htroot/ConfigSearchPage_p.html b/htroot/ConfigSearchPage_p.html
index 1abb99c57..6cff33faf 100644
--- a/htroot/ConfigSearchPage_p.html
+++ b/htroot/ConfigSearchPage_p.html
@@ -238,6 +238,7 @@ var solr= $.getJSON("solr/collection1/select?q=*:*&defType=edismax&start=0&rows=
<td>&nbsp;|&nbsp;<a href="proxy.html" target="LayouTest">View via Proxy</a></td>
<td>&nbsp;|&nbsp;<a href="HostBrowser.html" target="LayouTest"><img src="env/grafics/minitree.png" width="15" height="8" title="Browse index" alt="Browse index"/></a></td>
<td>&nbsp;|&nbsp;<a href="yacysearch.html" target="LayouTest">Snapshots</a></td>
+ #(search.result.show.ranking)#::<td>&nbsp;|&nbsp;<span title="Raw ranking score value">Ranking: 1.12195955E9</span>#(/search.result.show.ranking)#
</tr>
<tr>
<td></td>
@@ -257,6 +258,13 @@ var solr= $.getJSON("solr/collection1/select?q=*:*&defType=edismax&start=0&rows=
</td>
<td align="center"><input type="checkbox" name="search.result.show.hostbrowser" value="true" #(search.result.show.hostbrowser)#::checked="checked" #(/search.result.show.hostbrowser)# /></td>
<td align="center"><input type="checkbox" name="search.result.show.snapshots" value="true" #(search.result.show.snapshots)#::checked="checked" #(/search.result.show.snapshots)# /></td>
+ #(search.result.show.ranking)#::<td align="center">
+ <span class="info" style="padding-left: 10px"><img src="env/grafics/i16.gif" alt="info"/><span>
+ Ranking score value, mainly for debug/analysis purpose, configured in <a href="Settings_p.html?page=debug">Debug/Analysis Settings</a><br>
+ Menu: System Administration > Advanced Settings > Debug/Analysis Settings
+ </span></span>
+ </td>
+ #(/search.result.show.ranking)#
</tr>
</table>
</p>
diff --git a/htroot/ConfigSearchPage_p.java b/htroot/ConfigSearchPage_p.java
index 8593300c5..9ae5b5249 100644
--- a/htroot/ConfigSearchPage_p.java
+++ b/htroot/ConfigSearchPage_p.java
@@ -194,6 +194,7 @@ public class ConfigSearchPage_p {
prop.put("search.result.show.proxy", sb.getConfigBool("search.result.show.proxy", false) ? 1 : 0);
prop.put("search.result.show.hostbrowser", sb.getConfigBool("search.result.show.hostbrowser", false) ? 1 : 0);
prop.put("search.result.show.snapshots", sb.getConfigBool("search.result.show.snapshots", false) ? 1 : 0);
+ prop.put("search.result.show.ranking", sb.getConfigBool(SwitchboardConstants.SEARCH_RESULT_SHOW_RANKING, SwitchboardConstants.SEARCH_RESULT_SHOW_RANKING_DEFAULT) ? 1 : 0);
prop.put("search.navigation.location", sb.getConfig("search.navigation", "").indexOf("location",0) >= 0 ? 1 : 0);
// prop.put("search.navigation.filetype", sb.getConfig("search.navigation", "").indexOf("filetype",0) >= 0 ? 1 : 0);
diff --git a/htroot/SettingsAck_p.java b/htroot/SettingsAck_p.java
index 2380f5882..d98d4ffd6 100644
--- a/htroot/SettingsAck_p.java
+++ b/htroot/SettingsAck_p.java
@@ -576,6 +576,9 @@ public class SettingsAck_p {
tickedCheckbox = post.containsKey("searchTestLocalSolr");
env.setConfig(SwitchboardConstants.DEBUG_SEARCH_REMOTE_SOLR_TESTLOCAL, tickedCheckbox);
+ tickedCheckbox = post.containsKey("searchShowRanking");
+ env.setConfig(SwitchboardConstants.SEARCH_RESULT_SHOW_RANKING, tickedCheckbox);
+
/* For easier user understanding, the following flags controlling data sources selection
* are rendered in the UI as checkboxes corresponding to enabled value when ticked */
tickedCheckbox = post.containsKey("searchLocalDHT");
diff --git a/htroot/Settings_Debug.inc b/htroot/Settings_Debug.inc
index b30b158bd..7e5f840e0 100644
--- a/htroot/Settings_Debug.inc
+++ b/htroot/Settings_Debug.inc
@@ -118,6 +118,26 @@
</fieldset>
+ <fieldset>
+ <legend>Ranking information</legend>
+
+ <div class="form-group">
+ <div class="col-sm-4">
+ <div class="checkbox">
+ <label>
+ <input name="searchShowRanking" id="searchShowRanking"
+ type="checkbox" #(searchShowRankingChecked)#::checked#(/searchShowRankingChecked)#
+ aria-describedby="searchShowRankingInfo"/>
+ Show search results scores
+ </label>
+ </div>
+ </div>
+ <div class="col-sm-8" id="searchShowRankingInfo">
+ When checked, the raw ranking score value is displayed for each text search result in the HTML results page.
+ </div>
+ </div>
+ </fieldset>
+
<div class="col-sm-6">
<input type="submit" class="btn btn-primary" name="debugAnalysisSettings" value="Submit" aria-describedby="submitInfo"/>
<em id="submitInfo">Changes will take effect immediately.</em>
diff --git a/htroot/Settings_p.java b/htroot/Settings_p.java
index 5630daa87..773cf71c4 100644
--- a/htroot/Settings_p.java
+++ b/htroot/Settings_p.java
@@ -202,10 +202,6 @@ public final class Settings_p {
prop.put("server.https_port.ssl", sb.getConfig(SwitchboardConstants.SERVER_SSLPORT,"8443"));
prop.put("port.shutdown", sb.getConfig(SwitchboardConstants.SERVER_SHUTDOWNPORT, "-1"));
- // debug/analysis
- prop.put("solrBinaryResponseChecked", env.getConfigBool(SwitchboardConstants.REMOTE_SOLR_BINARY_RESPONSE_ENABLED,
- SwitchboardConstants.REMOTE_SOLR_BINARY_RESPONSE_ENABLED_DEFAULT) ? 1 : 0);
-
// Referrer Policy
final String metaPolicy = env.getConfig(SwitchboardConstants.REFERRER_META_POLICY,
SwitchboardConstants.REFERRER_META_POLICY_DEFAULT);
@@ -229,6 +225,10 @@ public final class Settings_p {
prop.put("searchResultNoReferrerChecked", env.getConfigBool(SwitchboardConstants.SEARCH_RESULT_NOREFERRER,
SwitchboardConstants.SEARCH_RESULT_NOREFERRER_DEFAULT) ? 1 : 0);
+ // debug/analysis
+ prop.put("solrBinaryResponseChecked", env.getConfigBool(SwitchboardConstants.REMOTE_SOLR_BINARY_RESPONSE_ENABLED,
+ SwitchboardConstants.REMOTE_SOLR_BINARY_RESPONSE_ENABLED_DEFAULT) ? 1 : 0);
+
/* For easier user understanding, the following flags controlling data sources selection
* are rendered in the UI as checkboxes corresponding to enabled value when ticked */
prop.put("searchLocalDHTChecked", !env.getConfigBool(SwitchboardConstants.DEBUG_SEARCH_LOCAL_DHT_OFF, false) ? 1 : 0);
@@ -239,6 +239,8 @@ public final class Settings_p {
prop.put("searchTestLocalDHTChecked", env.getConfigBool(SwitchboardConstants.DEBUG_SEARCH_REMOTE_DHT_TESTLOCAL, false) ? 1 : 0);
prop.put("searchTestLocalSolrChecked", env.getConfigBool(SwitchboardConstants.DEBUG_SEARCH_REMOTE_SOLR_TESTLOCAL, false) ? 1 : 0);
+ prop.put("searchShowRankingChecked", env.getConfigBool(SwitchboardConstants.SEARCH_RESULT_SHOW_RANKING, SwitchboardConstants.SEARCH_RESULT_SHOW_RANKING_DEFAULT) ? 1 : 0);
+
// return rewrite properties
return prop;
}
diff --git a/htroot/yacysearchitem.html b/htroot/yacysearchitem.html
index e5544e362..ce3d072ba 100644
--- a/htroot/yacysearchitem.html
+++ b/htroot/yacysearchitem.html
@@ -38,7 +38,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)#
+ #(showRanking)#::&nbsp;|&nbsp;<span title="Raw ranking score value">Ranking: #[ranking]#</span>#(/showRanking)#
</p>
</div>
::
diff --git a/source/net/yacy/search/SwitchboardConstants.java b/source/net/yacy/search/SwitchboardConstants.java
index 3df5c1a55..ff69a6abe 100644
--- a/source/net/yacy/search/SwitchboardConstants.java
+++ b/source/net/yacy/search/SwitchboardConstants.java
@@ -550,6 +550,12 @@ public final class SwitchboardConstants {
/** Default setting value controlling whether a noreferrer link type should be added to search result links */
public static final boolean SEARCH_RESULT_NOREFERRER_DEFAULT = false;
+
+ /** Key of the setting controlling whether the ranking score value should be displayed for each search result in the HTML results page */
+ public static final String SEARCH_RESULT_SHOW_RANKING = "search.result.show.ranking";
+
+ /** Default setting value controlling whether the ranking score value should be displayed for each search result in the HTML results page */
+ public static final boolean SEARCH_RESULT_SHOW_RANKING_DEFAULT = false;
/**
* ranking+evaluation