Ejemplo n.º 1
0
        private void BindHotKeywords()
        {
            SearchLogStasticsService statService = new SearchLogStasticsService();
            var hotKeywords = statService.GetHotKeyword();

            rptHotList.DataSource = hotKeywords;
            rptHotList.DataBind();
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            // 注意这里传过来的参数name是term
            string keyword = context.Request["term"];

            IList <string>           keywordList = new List <string>();
            SearchLogStasticsService statService = new SearchLogStasticsService();
            DataTable dt = statService.GetSuggestion(keyword);

            foreach (DataRow dr in dt.Rows)
            {
                keywordList.Add(Convert.ToString(dr["Word"]));
            }

            JavaScriptSerializer jss = new JavaScriptSerializer();
            string json = jss.Serialize(keywordList);

            context.Response.Write(json);
        }
 public BuildStasticsJob()
 {
     stasticService = new SearchLogStasticsService();
 }