Last active
February 27, 2016 21:19
-
-
Save kdhollow/76199a0187fe92f4b3a0 to your computer and use it in GitHub Desktop.
Adding Top and Skip to AirportController
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
long count = 0; | |
var result = await azureSearchEngine.SearchDocumentsAsync<Airport>(indexName, searchText, facetfields, true, top, model.Skip, | |
model.Filter, | |
airport => new Airport() {Id = airport.Id, Identifier = airport.Identifier, Name = airport.Name, City = airport.City, State = airport.State, Chart = airport.Chart, Region = airport.Region, AfdLink = airport.AfdLink}, | |
(facetName, facets) => | |
{ | |
facetResults.Add(new FacetInfo() {FacetName = facetName, Facets = facets}); | |
}, | |
documentCount => { if (null != documentCount) count = documentCount.Value; }); | |
var resultsModel = new AirportSearch(); | |
resultsModel.SearchText = model.SearchText; | |
resultsModel.AirportSearchResults = result.ToList(); | |
resultsModel.FacetResults = facetResults; | |
resultsModel.Filter = model.Filter; | |
resultsModel.Top = model.Top; | |
resultsModel.Skip = model.Skip; | |
resultsModel.Count = count; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment