SearchResourceContext nodeSearchContext = new SearchResourceContext(searchResourceContext);
nodeSearchContext.setBusinessControlFor(node);
nodeSearchContext.setDocumentType(getDocumentType());
// Create the olatDocument for the feed course node itself
OlatDocument feedNodeDoc = new FeedNodeDocument(feed, nodeSearchContext);
indexer.addDocument(feedNodeDoc.getLuceneDocument());
// Make sure images are displayed properly
String mapperBaseURL = Path.getFeedBaseUri(feed, null, course.getResourceableId(), node.getIdent());
Filter mediaUrlFilter = FilterFactory.getBaseURLToMediaRelativeURLFilter(mapperBaseURL);
// Only index items. Feed itself is indexed by RepositoryEntryIndexer.
for (Item item : feed.getPublishedItems()) {
OlatDocument itemDoc = new FeedItemDocument(item, nodeSearchContext, mediaUrlFilter);
indexer.addDocument(itemDoc.getLuceneDocument());
}
} catch (NullPointerException e) {
log.error("Error indexing feed:" + repoEntryName, e);
}