Skip to content

Instantly share code, notes, and snippets.

@kdhollow
Created February 24, 2016 07:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kdhollow/4ad9997cba1d5e37a052 to your computer and use it in GitHub Desktop.
Save kdhollow/4ad9997cba1d5e37a052 to your computer and use it in GitHub Desktop.
Azure Search Data Parse and Index Code
var airportIndexTasks = Parse( async (identifier, city, state, name, chart, region, afdlink) =>
{
var airport = new Airport()
{
Id = Guid.NewGuid().ToString("N"),
Identifier = identifier,
City = city,
State = state,
Name = name,
Chart = chart,
Region = region,
AfdLink = afdlink
};
await azureSearchEngine.IndexItemsAsync(indexName, new List<Airport>() {airport},
async indName =>
{
await CreateIndexInternalAsync(indName);
});
});
await Task.WhenAll(airportIndexTasks);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment