Ejemplo n.º 1
0
        public IndexedModelResult FillIndex()
        {
            try
            {
                var documentsToIndex = GetDocumentsForIndexing().ToList();
                Index(documentsToIndex);

                return(_indexerDiagnosticService.GetSuccessResult(typeof(DocumentIndexer).Name, documentsToIndex));
            }
            catch (Exception e)
            {
                return(_indexerDiagnosticService.GetFailedResult(e.Message + e.StackTrace, typeof(DocumentIndexer).Name));
            }
        }
Ejemplo n.º 2
0
        public IndexedModelResult FillIndex()
        {
            try
            {
                var tags           = _userTagProvider.GetAll();
                var searchableTags = tags.Select(Map).ToList();
                _elasticTagIndex.Index(searchableTags);

                return(_indexerDiagnosticService.GetSuccessResult(typeof(UserTagsSearchIndexer).Name, searchableTags));
            }
            catch (Exception e)
            {
                return(_indexerDiagnosticService.GetFailedResult(e.Message + e.StackTrace, typeof(UserTagsSearchIndexer).Name));
            }
        }
Ejemplo n.º 3
0
        public virtual IndexedModelResult FillIndex()
        {
            try
            {
                var actualUsers     = _intranetMemberService.GetAll().Where(u => !u.Inactive);
                var searchableUsers = actualUsers.Select(_searchableMemberMapper.Map).ToList();
                _elasticMemberIndex.Index(searchableUsers);

                return(_indexerDiagnosticService.GetSuccessResult(typeof(MembersIndexer <T>).Name, searchableUsers));
            }
            catch (Exception e)
            {
                return(_indexerDiagnosticService.GetFailedResult(e.Message + e.StackTrace, typeof(MembersIndexer <T>).Name));
            }
        }
Ejemplo n.º 4
0
        public IndexedModelResult FillIndex()
        {
            try
            {
                var activities           = GetAll().Where(IsInCache);
                var searchableActivities = activities.Select(Map).ToList();
                _activityIndex.DeleteByType(UintraSearchableTypeEnum.News);
                _activityIndex.Index(searchableActivities);

                return(_indexerDiagnosticService.GetSuccessResult(typeof(NewsService).Name, searchableActivities));
            }
            catch (Exception e)
            {
                return(_indexerDiagnosticService.GetFailedResult(e.Message + e.StackTrace, typeof(NewsService).Name));
            }
        }
Ejemplo n.º 5
0
        public IndexedModelResult FillIndex()
        {
            try
            {
                var homePage = Umbraco.Web.Composing.Current.UmbracoHelper.ContentAtRoot().First(pc =>
                                                                                                 pc.ContentType.Alias.Equals(_documentTypeAliasProvider.GetHomePage()));
                var contentPages = homePage.DescendantsOfType(_documentTypeAliasProvider.GetArticlePage());

                var searchableContents = contentPages
                                         .Where(pc => _searchUmbracoHelper.IsSearchable(pc))
                                         .Select(_searchUmbracoHelper.GetContent);
                _contentIndex.Index(searchableContents);

                return(_indexerDiagnosticService.GetSuccessResult(typeof(ContentIndexer).Name, searchableContents));
            }
            catch (Exception e)
            {
                return(_indexerDiagnosticService.GetFailedResult(e.Message + e.StackTrace, typeof(ContentIndexer).Name));
            }
        }