Пример #1
0
        public ActionResult Index() {
            var viewModel = new IndexViewModel {
                IndexEntries = Enumerable.Empty<IndexEntry>(),
                IndexProvider = _indexManager.GetSearchIndexProvider()
            };
            
            if (_indexManager.HasIndexProvider()) {
                viewModel.IndexEntries = _indexManager.GetSearchIndexProvider().List().Select(x => {
                    try {
                        return _indexingService.GetIndexEntry(x);
                    }
                    catch(Exception e) {
                        Logger.Error(e, "Index couldn't be read: " + x);
                        return new IndexEntry { 
                            IndexName = x,
                            IndexingStatus = IndexingStatus.Unavailable
                        };
                    }
                });
            }
            
            // Services.Notifier.Information(T("The index might be corrupted. If you can't recover click on Rebuild."));

            return View(viewModel);
        }
Пример #2
0
        public ActionResult Index() {
            var viewModel = new IndexViewModel { IndexEntry = _indexingService.GetIndexEntry(DefaultIndexName) };

            if (viewModel.IndexEntry == null)
                Services.Notifier.Information(T("There is no search index to manage for this site."));

            return View(viewModel);
        }
Пример #3
0
        public ActionResult Index() {
            var viewModel = new IndexViewModel();
            
            try {
                viewModel.IndexEntry = _indexingService.GetIndexEntry(DefaultIndexName);

                if (viewModel.IndexEntry == null)
                    Services.Notifier.Information(T("There is no search index to manage for this site."));
            }
            catch(Exception e) {
                Logger.Error(e, "Search index couldn't be read.");
                Services.Notifier.Information(T("The index might be corrupted. If you can't recover click on Rebuild."));
            }

            return View(viewModel);
        }