/// <summary> /// 提交搜索引擎内容 /// </summary> private void Commit() { string id = Util.GetParamsString("id"); string modcode = Util.GetParamsString("modcode"); string title = Util.GetParamsString("title"); string content = Util.GetParamsString("content"); string filepathList = Util.GetParamsString("filepathList");//(文件全路径)多个文件路径之间用|分隔 DateTime?date = Util.GetParamsString("date").ToDateOrNull(); string param = Util.GetParamsString("param"); string searchparam1 = Util.GetParamsString("searchparam1"); string searchparam2 = Util.GetParamsString("searchparam2"); string searchparam3 = Util.GetParamsString("searchparam3"); content = GetContent(content, filepathList); try { string resultMsg = LuceneEntity.CommitContent(id, title, content, date, param, modcode, searchparam1, searchparam2, searchparam3); if (resultMsg != "") { Util.ResponseJsonResult(500, resultMsg); } else { Util.ResponseJsonResult(0, "提交成功"); } } catch (Exception ex) { Util.ResponseJsonResult(500, ex.Message); } }
private void DeleteAll() { try { string resultMsg = LuceneEntity.DeleteAll(); if (resultMsg != "") { Util.ResponseJsonResult(500, resultMsg); } else { Util.ResponseJsonResult(0, "删除成功"); } } catch (Exception ex) { Util.ResponseJsonResult(500, ex.Message); } }
private void Delete() { string id = Util.GetParamsString("id"); try { string resultMsg = LuceneEntity.Delete(id); if (resultMsg != "") { Util.ResponseJsonResult(500, resultMsg); } else { Util.ResponseJsonResult(0, "删除成功"); } } catch (Exception ex) { Util.ResponseJsonResult(500, ex.Message); } }
/// <summary> /// 搜索内容 /// </summary> private void Search() { string word = Util.GetParamsString("word"); string modcode = Util.GetParamsString("modcode"); int pagesize = Util.GetParamsString("pagesize").ToInt(); int pageindex = Util.GetParamsString("pageindex").ToInt(); string searchparam1 = Util.GetParamsString("searchparam1"); string searchparam2 = Util.GetParamsString("searchparam2"); string searchparam3 = Util.GetParamsString("searchparam3"); if (pageindex == 0) { pageindex = 1; } try { SearchResult searchResulg = LuceneEntity.SearchContent(modcode, word, pagesize, pageindex, searchparam1, searchparam2, searchparam3); Util.ResponseJsonResult(0, searchResulg); } catch (Exception ex) { Util.ResponseJsonResult(500, ex.Message); } }