Browse files

Restrict JS results resorting to authenticated users.

Until a more efficient DOM refresh model needing less XHR requests per
search is implemented.
  • Loading branch information...
luccioman committed Sep 16, 2017
1 parent 4ab961f commit 9049a926a511edea53f6b2622c06fcc50b96f2d7
Showing with 2 additions and 2 deletions.
  1. +1 −1 htroot/ConfigPortal_p.html
  2. +1 −1 htroot/
@@ -58,7 +58,7 @@ <h2>Integration of a Search Portal</h2>
<input type="radio" name="search.jsresort" value="false" #(search.jsresort)#checked="checked"::#(/search.jsresort)# />On demand, server-side
<label title="This usually improves ranking accuracy, but doesn't work well for users who have Javascript disabled, are using screen readers, or are on slow computers.">
<input type="radio" name="search.jsresort" value="true" #(search.jsresort)#::checked="checked"#(/search.jsresort)# />Automated, with JavaScript in the browser.
<input type="radio" name="search.jsresort" value="true" #(search.jsresort)#::checked="checked"#(/search.jsresort)# />Automated, with JavaScript in the browser <strong>for authenticated users only</strong>.
@@ -828,7 +828,7 @@ public static serverObjects respond(
prop.put("num-results_globalresults_remoteIndexCount", Formatter.number(theSearch.remote_rwi_available.get() + theSearch.remote_solr_available.get(), true));
prop.put("num-results_globalresults_remotePeerCount", Formatter.number(theSearch.remote_rwi_peerCount.get() + theSearch.remote_solr_peerCount.get(), true));
final boolean jsResort = global
final boolean jsResort = global && authenticated // for now enable JavaScript resorting only for authenticated users as it requires too much resources per search request
&& (contentdom == ContentDomain.ALL || contentdom == ContentDomain.TEXT) // For now JavaScript resorting can only be applied for text search
&& sb.getConfigBool(SwitchboardConstants.SEARCH_JS_RESORT, SwitchboardConstants.SEARCH_JS_RESORT_DEFAULT);
prop.put("jsResort", jsResort);

0 comments on commit 9049a92

Please sign in to comment.