public virtual ActionResult Rebuild(FolderIndexInfo[] model, string @return) { var data = new JsonResultData(ModelState); data.RunWithTry((resultData) => { foreach (var item in model) { var textFolder = new TextFolder(Repository, item.FolderName); IndexSummaryService.Rebuild(textFolder); } data.RedirectUrl = @return; }); return Json(data); }
private void GetFolderIndexInfoes(TextFolder textFolder, ref List<FolderIndexInfo> list, SearchSetting[] searchSettings) { if (searchSettings.Where(it => it.FolderName.EqualsOrNullEmpty(textFolder.FullName, StringComparison.OrdinalIgnoreCase)).Count() > 0) { FolderIndexInfo folderIndexInfo = new FolderIndexInfo(); folderIndexInfo.Folder = textFolder; folderIndexInfo.IndexedContents = SearchHelper.Search(textFolder.Repository, "", 1, 1, textFolder.FullName).TotalItemCount; folderIndexInfo.Rebuilding = IsRebuilding(textFolder); list.Add(folderIndexInfo); } foreach (var folder in Kooboo.CMS.Content.Services.ServiceFactory.TextFolderManager.ChildFolders(textFolder)) { GetFolderIndexInfoes(folder, ref list, searchSettings); } }