protected SearchItemInfoCollection GetContent(IndexingProviderBase 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); }
/// ----------------------------------------------------------------------------- /// <summary> /// Gets all the Search Documents for the given timeframe. /// </summary> /// <param name="indexer"></param> /// ----------------------------------------------------------------------------- private int GetAndStoreSearchDocuments(IndexingProviderBase indexer) { IList <SearchDocument> searchDocs; var portals = PortalController.Instance.GetPortals(); DateTime indexSince; var indexedCount = 0; foreach (var portal in portals.Cast <PortalInfo>()) { indexSince = this.FixedIndexingStartDate(portal.PortalID); try { indexedCount += indexer.IndexSearchDocuments( portal.PortalID, this.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 = this.FixedIndexingStartDate(-1); try { indexedCount += indexer.IndexSearchDocuments( Null.NullInteger, this.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); }