Esempio n. 1
0
        /// <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);
        }
Esempio n. 2
0
 public GutsMvcLogger(ILogger logger, GutsMvcUnitOfWork unitOfWork)
 {
     _logger     = logger;
     _unitOfWork = unitOfWork;
 }