Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Adding Top and Skip to AirportController
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