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; }
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); }