コード例 #1
0
ファイル: ModelFactory.cs プロジェクト: DevrexLabs/GeekStream
        public static SearchResultModel SearchResultModel(string query,int pageIndex)
        {
            var searchQuery = new SearchQuery(query,pageIndex);
            var model = new SearchResultModel();
            var queryResults = MvcApplication.DbClient.Execute(searchQuery);
            model.Results = queryResults.Items;
            model.Query = queryResults.Query;
            model.TotalResults = queryResults.TotalResults;
            model.PageIndex = pageIndex;
            model.Skipped = (pageIndex*100);

            ReplaceUrl(model.Results);

            return model;
        }
コード例 #2
0
        public static SearchResultModel SearchResultModel(string query, int pageIndex)
        {
            var searchQuery  = new SearchQuery(query, pageIndex);
            var model        = new SearchResultModel();
            var queryResults = MvcApplication.DbClient.Execute(searchQuery);

            model.Results      = queryResults.Items;
            model.Query        = queryResults.Query;
            model.TotalResults = queryResults.TotalResults;
            model.PageIndex    = pageIndex;
            model.Skipped      = (pageIndex * 100);

            ReplaceUrl(model.Results);

            return(model);
        }