コード例 #1
0
 internal int IndexNewsItems(IList <INewsItem> newsItems)
 {
     if (newsItems != null)
     {
         for (int i = 0; i < newsItems.Count; i++)
         {
             INewsItem item = newsItems[i];
             if (item != null)
             {
                 try {
                     // we do not always have the content loaded:
                     if (item.ContentType == ContentType.None && item.Feed != null && item.Feed.owner != null)
                     {
                         if (item.Feed.owner != null)
                         {
                             FeedSource handler = (FeedSource)item.Feed.owner;
                             handler.GetCachedContentForItem(item);
                         }
                     }
                     indexModifier.Add(LuceneNewsItemSearch.Document(item), item.Language);
                 } catch (Exception ex) {
                     Log.Error("IndexNewsItems() error", ex);
                 }
             }
         }
         return(newsItems.Count);
     }
     return(0);
 }