コード例 #1
0
        public WikipediaIndexingPluginTests(string path)
        {
            CompositionContainer pluginContainer = Factories.PluginContainer(false).Value;
            Interface.IFactoryCollection factoryCollection = new Factories.FactoryCollection(pluginContainer);
            Interface.ISettingsBuilder settingsBuilder = SettingsBuilder.SettingsBuilder(
                factoryCollection,
                new Validator.IndexValidator(factoryCollection));
            var searchService = new SearchDsl.SearchService(factoryCollection.SearchQueryFactory.GetAllModules());
            var dbFactory = new OrmLiteConnectionFactory(
                Constants.ConfFolder.Value + "//conf.sqlite",
                SqliteDialect.Provider);

            dbFactory.OpenDbConnection().Run(db => db.CreateTable<Index>(true));
            Interface.IIndexService indexservice = new FlexIndexModule.IndexService(
                settingsBuilder,
                searchService,
                dbFactory.Open(),
                false);

            indexservice.AddIndex(this.WikipediaIndex());
            this.StartIndexing(indexservice, path);
            Console.ReadLine();
        }
コード例 #2
0
ファイル: MockHelpers.cs プロジェクト: Enielezi/FlexSearch
        public static IFixture IntegartionFixtureSetup()
        {
            if (IntegrationFixture != null)
            {
                return IntegrationFixture;
            }

            IntegrationFixture = new Fixture().Customize(new AutoMoqCustomization());

            CompositionContainer pluginContainer = Factories.PluginContainer(false).Value;
            Interface.IFactoryCollection factoryCollection = new Factories.FactoryCollection(pluginContainer);
            Interface.ISettingsBuilder settingsBuilder = SettingsBuilder.SettingsBuilder(
                factoryCollection,
                new Validator.IndexValidator(factoryCollection));
            var searchService = new SearchDsl.SearchService(factoryCollection.SearchQueryFactory.GetAllModules());
            //var dbFactory = new OrmLiteConnectionFactory(
            //    Constants.ConfFolder.Value + "//conf.sqlite",
            //    SqliteDialect.Provider);

            //dbFactory.OpenDbConnection().Run(db => db.CreateTable<Index>(true));
            //Interface.IIndexService indexservice = new FlexIndexModule.IndexService(
            //    settingsBuilder,
            //    searchService,
            //    dbFactory.Open(),
            //    false);

            IntegrationFixture.Register(GetBasicIndexSettingsForContact);
            IntegrationFixture.Register(() => pluginContainer);
            IntegrationFixture.Register(() => factoryCollection);
            IntegrationFixture.Register(() => settingsBuilder);
            IntegrationFixture.Register(() => searchService);
            //IntegrationFixture.Register(() => indexservice);
            return IntegrationFixture;
        }