Example #1
0
        protected void btnSearch_Click(object sender, EventArgs e) {
            XK.SearchEngine.Model.Search_Model searchModel = new Search_Model();
            searchModel.Words = txt_KeyWord.Text;
            searchModel.Fields = new string[] { "Title", "Content" };
            searchModel.PageIndex = 0;
            searchModel.PageSize = 10;
            XK.SearchEngine.DocSearch doc = new DocSearch(searchModel, filePath: "Test", baseDataPath: basepath);

            SearchResult_Model<List<News>> searchResult = doc.Search<News>();
            List<News> news = searchResult.Data;

            rpt_SearchResult.BindExt(news);
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e) {
           
 
          //  AddDocIndex();
            XK.SearchEngine.Model.Search_Model searchModel = new Search_Model();
            searchModel.Words = "中秋";
            searchModel.Fields = new string[] { "Title", "Content" };
            searchModel.PageIndex = 0;
            searchModel.PageSize = 100;
            XK.SearchEngine.DocSearch doc = new DocSearch(searchModel,filePath:"Test", baseDataPath: basepath);

            SearchResult_Model<List<News>> searchResult = doc.Search<News>();
            List<News> news = searchResult.Data;
           // txt_KeyWord.Text = searchResult.Total.ToString();
            rpt_SearchResult.BindExt(news);

        }