예제 #1
0
        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");
        }
예제 #2
0
        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();
        }
예제 #3
0
        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);
                }
            }
        }