protected SearchItemInfoCollection GetContent(IndexingProviderBase indexer) { SearchItemInfoCollection searchItems = new SearchItemInfoCollection(); System.Collections.ArrayList portals = PortalController.Instance.GetPortals(); for (int index = 0; index <= portals.Count - 1; index++) { PortalInfo portal = (PortalInfo)portals[index]; searchItems.AddRange(indexer.GetSearchIndexItems(portal.PortalID)); } return(searchItems); }
/// ----------------------------------------------------------------------------- /// <summary> /// Gets all the Search Documents for the given timeframe. /// </summary> /// <param name="indexer"></param> /// ----------------------------------------------------------------------------- private int GetAndStoreSearchDocuments(IndexingProviderBase indexer) { IList <SearchDocument> searchDocs; System.Collections.ArrayList portals = PortalController.Instance.GetPortals(); DateTime indexSince; int indexedCount = 0; foreach (PortalInfo 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); }