예제 #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);
        }