public IQuery Get(SearchQuery query) { return new Query { QueryText = query.Query, IndexOfFirstResult = query.Page == 0 ? 0 : (query.Page - 1) * query.ResultsOnPage, NoOfResults = query.ResultsOnPage == 0 ? 0 : query.ResultsOnPage }; }
private ISearchResults GetSearchResults(SearchQuery searchQuery) { ISearchResults results = null; if (this.HttpContext != null) { results = this.HttpContext.Items["SearchResults"] as ISearchResults; } if (results != null) { return results; } var query = this.CreateQuery(searchQuery); results = this.searchServiceRepository.Get().Search(query); if (this.HttpContext != null) { this.HttpContext.Items.Add("SearchResults", results); } return results; }
private IQuery CreateQuery(SearchQuery query) { return this.queryRepository.Get(query); }