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); }
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("更新失败!")); } }