diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java index 4c2de7d7a..7ee909ae5 100644 --- a/htroot/yacysearch.java +++ b/htroot/yacysearch.java @@ -828,16 +828,17 @@ public class yacysearch { 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)); - /* In p2p mode only, add a link allowing user to resort already drained results, + final boolean jsResort = sb.getConfigBool(SwitchboardConstants.SEARCH_JS_RESORT, SwitchboardConstants.SEARCH_JS_RESORT_DEFAULT); + prop.put("jsResort", jsResort); + prop.put("num-results_jsResort", jsResort); + + /* In p2p mode only and if JavaScript resorting is not enabled, add a link allowing user to resort already drained results, * eventually including fetched results with higher ranks from the Solr and RWI stacks */ - prop.put("resortEnabled", global && !stealthmode && theSearch.resortCacheAllowed.availablePermits() > 0 ? 1 : 0); + prop.put("resortEnabled", !jsResort && global && !stealthmode && theSearch.resortCacheAllowed.availablePermits() > 0 ? 1 : 0); prop.put("resortEnabled_url", QueryParams.navurlBase(RequestHeader.FileType.HTML, theQuery, null, true).append("&startRecord=") .append(startRecord).append("&resortCachedResults=true").toString()); - prop.put("jsResort", sb.getConfigBool("search.jsresort", false) ); - prop.put("num-results_jsResort", sb.getConfigBool("search.jsresort", false) ); - // generate the search result lines; the content will be produced by another servlet for ( int i = 0; i < theQuery.itemsPerPage(); i++ ) { prop.put("results_" + i + "_item", startRecord + i); diff --git a/source/net/yacy/search/SwitchboardConstants.java b/source/net/yacy/search/SwitchboardConstants.java index 013796b74..a5a1213ef 100644 --- a/source/net/yacy/search/SwitchboardConstants.java +++ b/source/net/yacy/search/SwitchboardConstants.java @@ -546,6 +546,12 @@ public final class SwitchboardConstants { public static final String SEARCH_TARGET_SPECIAL_PATTERN = "search.target.special.pattern"; // ie 'own' addresses in topframe, 'other' in iframe public static final String SEARCH_VERIFY = "search.verify"; public static final String SEARCH_VERIFY_DELETE = "search.verify.delete"; + + /** Key of the setting controlling whether search results resorting by browser JavaScript is enabled */ + public static final String SEARCH_JS_RESORT = "search.jsresort"; + + /** Default setting value controlling whether search results resorting by browser JavaScript is enabled */ + public static final boolean SEARCH_JS_RESORT_DEFAULT = false; public static final String SEARCH_NAVIGATION_MAXCOUNT = "search.navigation.maxcount"; // max lines displayed in standard search navigators/facets