コード例 #1
0
 public void MakeIndex(PerformContext context)
 {
     List <ArticleIndex> list = _articleBusiness.GetIQueryable().Select(m => new ArticleIndex {
         Id = m.Id, Title = m.Title, Summary = m.Summary, CreateTime = m.CreateTime
     }).ToList();
     bool result = LuceneIndexHelper.MakeIndex(list);
 }
コード例 #2
0
        public ActionResult UpdateIndex()
        {
            List <ArticleIndex> list = _articleBusiness.GetIQueryable().Select(m => new ArticleIndex {
                Id = m.Id, Title = m.Title, Summary = m.Summary, CreateTime = m.CreateTime
            }).ToList();
            bool result = LuceneIndexHelper.MakeIndex(list);

            if (result)
            {
                return(Success("更新成功!"));
            }
            else
            {
                return(Error("更新失败!"));
            }
        }