Esempio n. 1
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Gets all the Search Documents within the timeframe for the given portal
        /// </summary>
        /// <param name="portalId"></param>
        /// <param name="indexer"></param>
        /// <param name="startDate"></param>
        /// <returns></returns>
        /// <history>
        ///     [vnguyen]   04/17/2013  created
        /// </history>
        /// -----------------------------------------------------------------------------
        private IEnumerable <SearchDocument> GetSearchDocuments(int portalId, IndexingProvider indexer, DateTime startDate)
        {
            var searchDocs = new List <SearchDocument>();
            var indexSince = FixedIndexingStartDate(portalId, startDate);

            searchDocs.AddRange(indexer.GetSearchDocuments(portalId, indexSince));
            return(searchDocs);
        }
Esempio n. 2
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Gets all the Search Documents for the given timeframe.
        /// </summary>
        /// <param name="indexer"></param>
        /// <param name="startDate"></param>
        /// <returns></returns>
        /// <history>
        ///     [vnguyen]   04/17/2013  created
        /// </history>
        /// -----------------------------------------------------------------------------
        private IEnumerable <SearchDocument> GetSearchDocuments(IndexingProvider indexer, DateTime startDate)
        {
            var      searchDocs = new List <SearchDocument>();
            var      portals    = PortalController.Instance.GetPortals();
            DateTime indexSince;

            foreach (var portal in portals.Cast <PortalInfo>())
            {
                indexSince = FixedIndexingStartDate(portal.PortalID, startDate);
                searchDocs.AddRange(indexer.GetSearchDocuments(portal.PortalID, indexSince));
            }

            // Include Host Level Items
            indexSince = FixedIndexingStartDate(-1, startDate);
            searchDocs.AddRange(indexer.GetSearchDocuments(-1, indexSince));

            return(searchDocs);
        }
Esempio n. 3
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Gets all the Search Documents for the given timeframe.
        /// </summary>
        /// <param name="indexer"></param>
        /// -----------------------------------------------------------------------------
        private int GetAndStoreSearchDocuments(IndexingProvider indexer)
        {
            IList <SearchDocument> searchDocs;
            var      portals = PortalController.Instance.GetPortals();
            DateTime indexSince;
            var      indexedCount = 0;

            foreach (var portal in portals.Cast <PortalInfo>())
            {
                indexSince = FixedIndexingStartDate(portal.PortalID);
                try
                {
                    indexedCount += indexer.IndexSearchDocuments(
                        portal.PortalID, SchedulerItem, indexSince, StoreSearchDocuments);
                }
                catch (NotImplementedException)
                {
#pragma warning disable 618
                    searchDocs = indexer.GetSearchDocuments(portal.PortalID, indexSince).ToList();
#pragma warning restore 618
                    StoreSearchDocuments(searchDocs);
                    indexedCount += searchDocs.Count();
                }
            }

            // Include Host Level Items
            indexSince = FixedIndexingStartDate(-1);
            try
            {
                indexedCount += indexer.IndexSearchDocuments(
                    Null.NullInteger, SchedulerItem, indexSince, StoreSearchDocuments);
            }
            catch (NotImplementedException)
            {
#pragma warning disable 618
                searchDocs = indexer.GetSearchDocuments(-1, indexSince).ToList();
#pragma warning restore 618
                StoreSearchDocuments(searchDocs);
                indexedCount += searchDocs.Count();
            }
            return(indexedCount);
        }
Esempio n. 4
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// Gets all the Search Documents within the timeframe for the given portal
 /// </summary>
 /// <param name="portalId"></param>
 /// <param name="indexer"></param>
 /// <param name="startDate"></param>
 /// <returns></returns>
 /// <history>
 ///     [vnguyen]   04/17/2013  created
 /// </history>
 /// -----------------------------------------------------------------------------
 private IEnumerable<SearchDocument> GetSearchDocuments(int portalId, IndexingProvider indexer, DateTime startDate)
 {
     var searchDocs = new List<SearchDocument>();
     var indexSince = FixedIndexingStartDate(portalId, startDate);
     searchDocs.AddRange(indexer.GetSearchDocuments(portalId, indexSince));
     return searchDocs;
 }
Esempio n. 5
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Gets all the Search Documents for the given timeframe.
        /// </summary>
        /// <param name="indexer"></param>
        /// <param name="startDate"></param>
        /// <returns></returns>
        /// <history>
        ///     [vnguyen]   04/17/2013  created
        /// </history>
        /// -----------------------------------------------------------------------------
        private IEnumerable<SearchDocument> GetSearchDocuments(IndexingProvider indexer, DateTime startDate)
        {
            var searchDocs = new List<SearchDocument>();
            var portalController = new PortalController();
            var portals = portalController.GetPortals();
            DateTime indexSince;

            foreach (var portal in portals.Cast<PortalInfo>())
            {
                indexSince = FixedIndexingStartDate(portal.PortalID, startDate);
                searchDocs.AddRange(indexer.GetSearchDocuments(portal.PortalID, indexSince));
            }

            // Include Host Level Items
            indexSince = FixedIndexingStartDate(-1, startDate);
            searchDocs.AddRange(indexer.GetSearchDocuments(-1, indexSince));
            
            return searchDocs;
        }