Пример #1
0
        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);
        }
Пример #2
0
        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);
        }