/// <summary> /// ES查询数据 /// </summary> /// <param name="indexName">索引名</param> /// <param name="queryString">检索词</param> /// <param name="sortField">排序字段</param> /// <param name="fields">返回字段</param> /// <param name="pageNumber">第几页</param> /// <param name="pagePerNo">显示条数</param> /// <param name="fm">返回值类型</param> /// <returns></returns> public PageResult <ResModel> GetResList(string indexName, string queryString, string sortField, string fields, int pageNumber, int pagePerNo, string fm) { PageResult <ResModel> list = new PageResult <ResModel>(); string searchResponse = esClient.EsSearch("", "", indexName, queryString, sortField, fields, pageNumber, pagePerNo, "", fm); JavaScriptSerializer json = new JavaScriptSerializer(); json.MaxJsonLength = Int32.MaxValue; Dictionary <string, object> dic = json.Deserialize <Dictionary <string, object> >(searchResponse); List <ResModel> reslist = GetResList(dic, out TotalCout); list.DataList = reslist; list.TotalCount = TotalCout; list.PageSize = pagePerNo; list.PageIndex = pageNumber; return(list); }