private static void BulkAll(TaggingService svc, IEnumerable <Tag> tags) { Console.WriteLine("Starting BulkAll Insert"); var sw = new Stopwatch(); sw.Start(); var response = svc.BulkAll(tags, allResponse => { Console.WriteLine($"Processing page #{allResponse.Page}"); }); sw.Stop(); Console.WriteLine($"Done BulkAll Insert in {sw.Elapsed} seconds"); }
static void Main(string[] args) { var svc = new TaggingService("securities"); for (var i = 0; i < 50; i++) { Console.WriteLine($"Processing iteration #{i + 1}"); var tags = GetTags(200_000); // IndexMany(svc, tags); BulkAll(svc, tags); } Console.WriteLine("Finished."); Console.Read(); }
private static void IndexMany(TaggingService svc, IEnumerable <Tag> tags) { Console.WriteLine("Starting IndexMany Insert"); var sw = new Stopwatch(); sw.Start(); // var response = svc.IndexMany(tags); var response = svc.IndexMany(tags); sw.Stop(); Console.WriteLine($"Done IndexMany Insert in {sw.Elapsed} seconds"); if (response.Errors) { foreach (var itemWithError in response.ItemsWithErrors) { Console.WriteLine("Failed to index document {0}: {1}", itemWithError.Id, itemWithError.Error); } } }