Skip to content

Instantly share code, notes, and snippets.

@vman
Last active December 15, 2015 00:19
var ctx = new SP.ClientContext.get_current();
var web = ctx.get_site().get_rootWeb();
var props = web.get_allProperties();
//Search Center Url
props.set_item("SRCH_ENH_FTR_URL","/sites/search/pages");
//Search Scope Drop down option
props.set_item("SRCH_SITE_DROPDOWN_MODE","HideScopeDD_DefaultContextual");
//Target Search Results page
props.set_item("SRCH_TRAGET_RESULTS_PAGE","/sites/Search/Pages/results.aspx");
web.update();
ctx.load(web);
ctx.executeQueryAsync(function () {
alert("Search Settings Modified");
},
function() {
alert("failed");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment