public DocumentOp(ServerManage mongo) { Mongo = mongo; List<string> IndexListNodes = new List<string>() { "Doclist_1", "Doclist_2", "Doclist_3", "Doclist_4", "Doclist_5", "Doclist_6", "Doclist_7", "Doclist_8", "Doclist_9", "Doclist_10" }; ListHash.Init(IndexListNodes,10); }
public Index(Config config, ServerManage mongo, ITokenizer tokenizer, IDocument docOp) { this.Config = config; this.Mongo = mongo; Tokenizer = tokenizer; DocOp = docOp; List<string> IndexListCollectionNodes = new List<string>() { "Ilist_1", "Ilist_2", "Ilist_3", "Ilist_4", "Ilist_5", "Ilist_6", "Ilist_7", "Ilist_8", "Ilist_9", "Ilist_10" }; ListHash.Init(IndexListCollectionNodes, 20); var baseServer = config.ServerHosts.SingleOrDefault(s => s.IsBase); if (baseServer == null) baseServer = config.ServerHosts[0]; baseClient = Mongo.MongoDbClient(baseServer.GroupName); DictCollection = baseClient.GetDatabase(Config.BaseDbName).GetCollection<BsonDocument>(DictColName); IncrementCollection = baseClient.GetDatabase(Config.BaseDbName).GetCollection<BsonDocument>("Increment"); LoadDict(); //单词字典索引结束 }