Beispiel #1
0
        public BulkElasticSuggestiveIndex Post(BulkElasticSuggestiveIndex t)
        {
            const int batchCount     = 2000;
            var       timerStopwatch = new Stopwatch();

            timerStopwatch.Start();
            var i = 0;

            Console.WriteLine(@"Elastic suggestive indexing started - ");

            CreateMapping();

            foreach (var elasticTitle in t.ElasticSuggestive.Batch(batchCount))
            {
                i++;
                timerStopwatch.Restart();
                Console.WriteLine(Environment.NewLine);
                Console.WriteLine(@"indexed records - " + i * batchCount);
                ElasticSearch.BulkIndex(elasticTitle.ToList());
                Console.WriteLine(@"iteration {0} took - {1} ms", i, timerStopwatch.ElapsedMilliseconds);
            }
            Console.WriteLine(@"Elastic suggestive indexing finished at - " + timerStopwatch.ElapsedMilliseconds);
            timerStopwatch.Stop();
            return(t);
        }
Beispiel #2
0
 public MergeProcessor()
 {
     TitleIndexList               = new BulkTitleIndex();
     ElasticTitleIndexList        = new BulkElasticTitleIndex();
     ElasticSuggestiveIndexList   = new BulkElasticSuggestiveIndex();
     ElasticOwnershipIndexList    = new BulkElasticOwnershipIndexCollection();
     BulkElasticGroupedTitleIndex = new BulkElasticGroupedTitleIndex();
 }