예제 #1
0
func (si SearchIndex) DeleteFeed(feed content.Feed) error {
	articles := feed.AllArticles()

	if !feed.HasErr() {
		si.logger.Infof("Removing all articles from the search index for feed '%s'\n", feed)

		si.batchDelete(articles)
	} else {
		return feed.Err()
	}
	return nil
}
예제 #2
0
파일: index.go 프로젝트: urandom/readeef
func (i Index) FeedDeleted(feed content.Feed) error {
	i.logger.Infof("Deleting article search index for feed '%s'\n", feed)

	articles := feed.AllArticles()

	if feed.HasErr() {
		return fmt.Errorf("Error deleting all articles of %s from the search index: %v\n", feed, feed.Err())
	} else {
		i.logger.Infof("Deleting article search index for feed '%s'\n", feed)

		return i.provider.BatchIndex(articles, data.BatchDelete)
	}

}