Exemple #1
0
 public MergeProcessor()
 {
     TitleIndexList               = new BulkTitleIndex();
     ElasticTitleIndexList        = new BulkElasticTitleIndex();
     ElasticSuggestiveIndexList   = new BulkElasticSuggestiveIndex();
     ElasticOwnershipIndexList    = new BulkElasticOwnershipIndexCollection();
     BulkElasticGroupedTitleIndex = new BulkElasticGroupedTitleIndex();
 }
        public BulkTitleIndex Index(BulkTitleIndex t)
        {
            var client         = new MongoClient(new MongoUrl(MongoUrl));
            var collectionName = "titleindex_" + DateTime.Now.Day;
            var collection     = client.GetDatabase(Database).GetCollection <TitleIndex>(collectionName);

            collection.Database.DropCollection(collectionName);


            foreach (var title in t.Titles.Batch(2000))
            {
                collection.InsertMany(title);
            }
            return(t);
        }