Last active
November 28, 2016 20:48
-
-
Save soen/82ce5083f590fc69248b92e366cee38d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (var context = ContentSearchManager.GetIndex("sitecore_master_index").CreateSearchContext()) | |
{ | |
var results = context.GetQueryable<SearchResultItem>() | |
.Where(...) | |
.Skip(0).Take(20) | |
.GetResults(); | |
var numberOfSearchResults = results.TotalHits; | |
var searchResuls = results.Hits; | |
// From here, either return the results and the number of search results | |
// to the UI, and calculate the number of pages etc., or simply just the | |
// SearchResults instance - that's up to you. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment