Permalink
Browse files

Improved previous merge "Show ranking in HTML UI".

- added the new setting as configurable in the "Debug/Analysis" settings
page. Debug/analysis is its main purpose for now as there is currently
no nice and "understansable" ranking score info servlet (see forum
discussion http://forum.yacy-websuche.de/viewtopic.php?f=8&t=5884 ) 
- render in the "Search Page Layout" page preview when enabled
- added constants
  • Loading branch information...
luccioman committed May 11, 2017
1 parent efe1232 commit d90b001e1b09e890231adec66fa9334a6f7f03ce
@@ -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
@@ -238,6 +238,7 @@ <h4 class="linktitle">
<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 @@ <h4 class="linktitle">
</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>
@@ -194,6 +194,7 @@ public static serverObjects respond(final RequestHeader header, final serverObje
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);
@@ -576,6 +576,9 @@ else if (!filter.equals("*")){
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");
@@ -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>
@@ -202,10 +202,6 @@ else if (page.equals("crawler")) {
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 @@ else if (page.equals("crawler")) {
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 @@ else if (page.equals("crawler")) {
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;
}
@@ -38,7 +38,7 @@ <h4 class="linktitle">
#(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>
::
@@ -550,6 +550,12 @@
/** 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

0 comments on commit d90b001

Please sign in to comment.