Пример #1
0
        protected SearchItemInfoCollection GetContent(int portalId, IndexingProvider indexer)
        {
            var searchItems = new SearchItemInfoCollection();

            searchItems.AddRange(indexer.GetSearchIndexItems(portalId));
            return(searchItems);
        }
Пример #2
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// GetContent gets the Portal's content and passes it to the Indexer
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="PortalID">The Id of the Portal</param>
        /// <param name="Indexer">The Index Provider that will index the content of the portal</param>
        /// <history>
        ///		[cnurse]	11/15/2004	documented
        /// </history>
        /// -----------------------------------------------------------------------------
        protected SearchItemInfoCollection GetContent(int PortalID, IndexingProvider Indexer)
        {
            var SearchItems = new SearchItemInfoCollection();

            SearchItems.AddRange(Indexer.GetSearchIndexItems(PortalID));
            return(SearchItems);
        }
Пример #3
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Gets all the Search Documents for the given timeframe.
        /// </summary>
        /// <param name="indexer"></param>
        /// -----------------------------------------------------------------------------
        private int GetAndStoreSearchDocuments(IndexingProvider indexer)
        {
            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)
                {
                    //Nothing to do, no fallback
                }
            }

            // Include Host Level Items
            indexSince = FixedIndexingStartDate(-1);
            try
            {
                indexedCount += indexer.IndexSearchDocuments(
                    Null.NullInteger, SchedulerItem, indexSince, StoreSearchDocuments);
            }
            catch (NotImplementedException)
            {
                //Again no fallback
            }
            return(indexedCount);
        }
Пример #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);
        }
Пример #5
0
        /// <Summary>
        /// GetContent gets the Portal's content and passes it to the Indexer
        /// </Summary>
        /// <Param name="PortalID">The Id of the Portal</Param>
        /// <Param name="Indexer">
        /// The Index Provider that will index the content of the portal
        /// </Param>
        protected SearchItemInfoCollection GetContent( int PortalID, IndexingProvider Indexer )
        {
            SearchItemInfoCollection SearchItems = new SearchItemInfoCollection();

            SearchItems.AddRange(Indexer.GetSearchIndexItems(PortalID));

            return SearchItems;
        }
Пример #6
0
        protected SearchItemInfoCollection GetContent(IndexingProvider indexer)
        {
            var searchItems = new SearchItemInfoCollection();
            var portals     = PortalController.Instance.GetPortals();

            for (var index = 0; index <= portals.Count - 1; index++)
            {
                var portal = (PortalInfo)portals[index];
                searchItems.AddRange(indexer.GetSearchIndexItems(portal.PortalID));
            }
            return(searchItems);
        }
Пример #7
0
        protected SearchItemInfoCollection GetContent(IndexingProvider indexer)
        {
            var searchItems = new SearchItemInfoCollection();
            var objPortals  = new PortalController();
            var arrPortals  = objPortals.GetPortals();
            int intPortal;

            for (intPortal = 0; intPortal <= arrPortals.Count - 1; intPortal++)
            {
                var objPortal = (PortalInfo)arrPortals[intPortal];
                searchItems.AddRange(indexer.GetSearchIndexItems(objPortal.PortalID));
            }
            return(searchItems);
        }
Пример #8
0
        /// <Summary>
        /// GetContent gets all the content and passes it to the Indexer
        /// </Summary>
        /// <Param name="Indexer">
        /// The Index Provider that will index the content of the portal
        /// </Param>
        protected SearchItemInfoCollection GetContent( IndexingProvider Indexer )
        {
            SearchItemInfoCollection SearchItems = new SearchItemInfoCollection();
            PortalController objPortals = new PortalController();
            PortalInfo objPortal;

            ArrayList arrPortals = objPortals.GetPortals();
            int intPortal;
            for (intPortal = 0; intPortal <= arrPortals.Count - 1; intPortal++)
            {
                objPortal = (PortalInfo)arrPortals[intPortal];

                SearchItems.AddRange(Indexer.GetSearchIndexItems(objPortal.PortalID));
            }
            return SearchItems;
        }
Пример #9
0
        /// <Summary>
        /// GetContent gets all the content and passes it to the Indexer
        /// </Summary>
        /// <Param name="Indexer">
        /// The Index Provider that will index the content of the portal
        /// </Param>
        protected SearchItemInfoCollection GetContent(IndexingProvider Indexer)
        {
            SearchItemInfoCollection SearchItems = new SearchItemInfoCollection();
            PortalController         objPortals  = new PortalController();
            PortalInfo objPortal;

            ArrayList arrPortals = objPortals.GetPortals();
            int       intPortal;

            for (intPortal = 0; intPortal <= arrPortals.Count - 1; intPortal++)
            {
                objPortal = (PortalInfo)arrPortals[intPortal];

                SearchItems.AddRange(Indexer.GetSearchIndexItems(objPortal.PortalID));
            }
            return(SearchItems);
        }
Пример #10
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);
        }
Пример #11
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);
        }
Пример #12
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;
 }
Пример #13
0
        /// <Summary>IndexContent indexes the Portal's content</Summary>
        /// <Param name="PortalID">The Id of the Portal</Param>
        public void IndexContent(int PortalID)
        {
            IndexingProvider indexer = IndexingProvider.Instance();

            SearchDataStoreProvider.Instance().StoreSearchItems(this.GetContent(PortalID, indexer));
        }
Пример #14
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// IndexContent indexes all Portal content
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        ///		[cnurse]	11/15/2004	documented
        /// </history>
        /// -----------------------------------------------------------------------------
        public void IndexContent()
        {
            IndexingProvider Indexer = IndexingProvider.Instance();

            SearchDataStoreProvider.Instance().StoreSearchItems(GetContent(Indexer));
        }
Пример #15
0
 protected SearchItemInfoCollection GetContent(int portalId, IndexingProvider indexer)
 {
     var searchItems = new SearchItemInfoCollection();
     searchItems.AddRange(indexer.GetSearchIndexItems(portalId));
     return searchItems;
 }
Пример #16
0
 // dynamically create provider
 private static void CreateProvider()
 {
     objProvider = (IndexingProvider)Reflection.CreateObject("searchIndex");
 }
Пример #17
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;
        }
Пример #18
0
 protected SearchItemInfoCollection GetContent(IndexingProvider indexer)
 {
     var searchItems = new SearchItemInfoCollection();
     var portals = PortalController.Instance.GetPortals();
     for (var index = 0; index <= portals.Count - 1; index++)
     {
         var portal = (PortalInfo) portals[index];
         searchItems.AddRange(indexer.GetSearchIndexItems(portal.PortalID));
     }
     return searchItems;
 }
Пример #19
0
 protected SearchItemInfoCollection GetContent(IndexingProvider indexer)
 {
     var searchItems = new SearchItemInfoCollection();
     var objPortals = new PortalController();
     var arrPortals = objPortals.GetPortals();
     int intPortal;
     for (intPortal = 0; intPortal <= arrPortals.Count - 1; intPortal++)
     {
         var objPortal = (PortalInfo) arrPortals[intPortal];
         searchItems.AddRange(indexer.GetSearchIndexItems(objPortal.PortalID));
     }
     return searchItems;
 }
Пример #20
0
 // dynamically create provider
 private static void CreateProvider()
 {
     objProvider = (IndexingProvider)Reflection.CreateObject("searchIndex");
 }