public static IIndexStorage MongoDB() { var mongoClient = new MongoClient("mongodb://localhost"); var mongoDatabase = mongoClient.GetDatabase("FullText"); var mongoBucket = new GridFSBucket <string>(mongoDatabase, new GridFSBucketOptions { BucketName = $"bucket_{DateTime.UtcNow.Ticks}" }); var storage = new MongoIndexStorage(mongoBucket); return(storage); }
private static IIndexStorage CreateStorage() { var mongoClient = new MongoClient("mongodb://localhost"); var mongoDatabase = mongoClient.GetDatabase("FullText"); var mongoBucket = new GridFSBucket <string>(mongoDatabase, new GridFSBucketOptions { BucketName = "fs" }); var storage = new MongoIndexStorage(mongoBucket); return(storage); }