/// <summary> /// 初始化Lucene.Net索引 /// </summary> public void InitIndex(GutsMvcUnitOfWork uf) { var replies = uf.ReplyRepository.GetAll().Join(uf.TopicRepository.GetAll(), x => x.TopicId, y => y.Id, (x, y) => new MoContentSearchItem { Id = x.Id, TopicId = y.Id, TopicName = x.TopicName, Content = x.Message, ReplyType = x.ReplyType, ReplyIndex = x.ReplyIndex, CreateTime = x.CreateTime.ToStandardFormatString() }) .ToList(); JiebaLucene.Instance.CreateIndex(replies); }
public GutsMvcLogger(ILogger logger, GutsMvcUnitOfWork unitOfWork) { _logger = logger; _unitOfWork = unitOfWork; }