Esempio n. 1
0
        public void UpdateIndex(SueetieIndexTaskItem _taskItem)
        {
            DateTime startTime = DateTime.Now;

            try
            {
                _taskItem.BlogPosts     = AddSueetieSearchDocs(ProcessBlogPosts(_taskItem.TaskStartDateTime));
                _taskItem.WikiPages     = AddSueetieSearchDocs(ProcessSueetieWikiPages(_taskItem.TaskStartDateTime));
                _taskItem.ForumMessages = AddSueetieSearchDocs(ProcessSueetieForumMessages(_taskItem.TaskStartDateTime));
                _taskItem.MediaAlbums   = AddSueetieSearchDocs(ProcessSueetieMediaAlbums(_taskItem.TaskStartDateTime));
                _taskItem.MediaObjects  = AddSueetieSearchDocs(ProcessSueetieMediaObjects(_taskItem.TaskStartDateTime));
                _taskItem.ContentPages  = AddSueetieSearchDocs(ProcessSueetieContentPages(_taskItem.TaskStartDateTime));

                _taskItem.DocumentsIndexed = GetTotalIndexedCount();
                CommitAndCloseWriter();

                if (_taskItem.TaskTypeID == (int)SueetieTaskType.BuildSearchIndex)
                {
                    SueetieSearchDataProvider _provider = SueetieSearchDataProvider.LoadProvider();
                    _provider.UpdateAndEndTask(_taskItem);
                }
                DateTime endTime = DateTime.Now;
                SueetieLogs.LogSiteEntry(SiteLogType.General, SiteLogCategoryType.TasksMessage, "INDEX SUCCESSFUL: " +
                                         string.Format("Blog Posts: {0}, Wiki Pages: {1}, Forum Messages: {2}, Media Albums: {3}, Media Objects: {4}, Content Pages: {5}, Indexed Documents: {6}",
                                                       _taskItem.BlogPosts, _taskItem.WikiPages, _taskItem.ForumMessages, _taskItem.MediaAlbums, _taskItem.MediaObjects, _taskItem.ContentPages, _taskItem.DocumentsIndexed) +
                                         " - REBUILD INDEX DURATION: " + (endTime - startTime).TotalMilliseconds + " Milliseconds.");
            }
            catch (Exception e)
            {
                DateTime endTime = DateTime.Now;
                SueetieLogs.LogSearchException("SEARCH REBUILD INDEX ERROR: " + e.Message + "\n\nSTACKTRACE: " + e.StackTrace + " - REBUILD INDEX DURATION: " + (endTime - startTime).TotalMilliseconds + " Milliseconds.");
            }
        }
Esempio n. 2
0
        public static SueetieIndexTaskItem GetSueetieIndexTaskItem(int taskID)
        {
            SueetieSearchDataProvider _provider = SueetieSearchDataProvider.LoadProvider();

            return(_provider.GetSueetieIndexTaskItem(taskID));
        }
Esempio n. 3
0
        private List <SueetieMediaObject> GetSueetieMediaObjectList(DateTime pubDate)
        {
            SueetieSearchDataProvider _provider = SueetieSearchDataProvider.LoadProvider();

            return(_provider.GetSueetieMediaObjectsToIndex(pubDate));
        }
Esempio n. 4
0
        private List <SueetieForumMessage> GetSueetieForumMessageList(int contenttypeID, DateTime pubDate)
        {
            SueetieSearchDataProvider _provider = SueetieSearchDataProvider.LoadProvider();

            return(_provider.GetSueetieForumMessagesToIndex(contenttypeID, pubDate));
        }
Esempio n. 5
0
        private List <SueetieBlogPost> GetSueetieBlogPostList(int contenttypeID, DateTime pubDate)
        {
            SueetieSearchDataProvider _provider = SueetieSearchDataProvider.LoadProvider();

            return(_provider.GetSueetieBlogPostsToIndex(contenttypeID, pubDate));
        }