diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/SearchServiceController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/SearchServiceController.cs index 1d738dbb1a9..f07fb81e33e 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/SearchServiceController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/SearchServiceController.cs @@ -18,6 +18,7 @@ namespace DotNetNuke.Web.InternalServices using DotNetNuke.Common; using DotNetNuke.Common.Utilities; using DotNetNuke.Data; + using DotNetNuke.Entities.Controllers; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Modules.Definitions; using DotNetNuke.Entities.Tabs; @@ -37,7 +38,6 @@ public class SearchServiceController : DnnApiController private const string ModuleTitleCacheKey = "SearchModuleTabTitle_{0}"; private const CacheItemPriority ModuleTitleCachePriority = CacheItemPriority.Normal; private const int ModuleTitleCacheTimeOut = 20; - private static readonly Regex GroupedBasicViewRegex = new Regex("userid(/|\\|=)(\\d+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); private int htmlModuleDefitionId; @@ -125,6 +125,7 @@ public HttpResponseMessage Search(string search, string culture, int pageIndex, var moduleDefids = GetSearchModuleDefIds(settings, contentSources); var portalIds = this.GetSearchPortalIds(settings, -1); var userSearchTypeId = SearchHelper.Instance.GetSearchTypeByName("user").SearchTypeId; + var maximumPageSize = HostController.Instance.GetInteger("Search_MaxResultPerPage", 100); var more = false; var totalHits = 0; @@ -132,6 +133,11 @@ public HttpResponseMessage Search(string search, string culture, int pageIndex, if (portalIds.Any() && searchTypeIds.Any() && (!string.IsNullOrEmpty(cleanedKeywords) || tags.Any())) { + if (pageSize > maximumPageSize) + { + pageSize = maximumPageSize; + } + var query = new SearchQuery { KeyWords = cleanedKeywords, diff --git a/Dnn.AdminExperience/ClientSide/SiteSettings.Web/src/components/basicSearchSettings/index.jsx b/Dnn.AdminExperience/ClientSide/SiteSettings.Web/src/components/basicSearchSettings/index.jsx index 46b711a329e..796c26cfc2f 100644 --- a/Dnn.AdminExperience/ClientSide/SiteSettings.Web/src/components/basicSearchSettings/index.jsx +++ b/Dnn.AdminExperience/ClientSide/SiteSettings.Web/src/components/basicSearchSettings/index.jsx @@ -21,7 +21,8 @@ class BasicSearchSettingsPanelBody extends Component { basicSearchSettings: undefined, error: { minlength: false, - maxlength: false + maxlength: false, + maxresult: false }, triedToSubmit: false }; @@ -72,6 +73,13 @@ class BasicSearchSettingsPanelBody extends Component { error["minlength"] = false; } + if (!re.test(basicSearchSettings[key]) && key === "MaxResultPerPage") { + error["maxresult"] = true; + } + else if (re.test(basicSearchSettings[key]) && key === "MaxResultPerPage") { + error["maxresult"] = false; + } + if (key === "MaxWordLength" && (!re.test(basicSearchSettings[key]) || parseInt(basicSearchSettings["MinWordLength"]) >= parseInt(basicSearchSettings["MaxWordLength"]))) { error["maxlength"] = true; @@ -153,50 +161,94 @@ class BasicSearchSettingsPanelBody extends Component { const {state} = this; if (this.isHost()) { if (state.basicSearchSettings) { - const columnOne =