Пример #1
0
        public virtual Lucene.Net.Store.Directory CreateDirectory(LuceneIndexer indexer, string luceneIndexFolder)
        {
            var indexFolder = new DirectoryInfo(luceneIndexFolder);
            var tempFolder  = GetLocalStorageDirectory(indexFolder);

            var simpleFsDirectory = new SimpleFSDirectory(tempFolder);

            simpleFsDirectory.SetLockFactory(DirectoryTracker.DefaultLockFactory(tempFolder));
            return(simpleFsDirectory);
        }
        public Lucene.Net.Store.Directory CreateDirectory(LuceneIndexer indexer, string luceneIndexFolder)
        {
            var indexFolder = new DirectoryInfo(luceneIndexFolder);
            var codeGen     = GetLocalStorageDirectory(indexFolder);
            var master      = new DirectoryInfo(luceneIndexFolder);
            var masterDir   = new SimpleFSDirectory(master);
            var cacheDir    = new SimpleFSDirectory(codeGen);

            masterDir.SetLockFactory(DirectoryTracker.DefaultLockFactory(master));
            cacheDir.SetLockFactory(DirectoryTracker.DefaultLockFactory(codeGen));
            return(new SyncDirectory(masterDir, cacheDir));
        }