示例#1
0
 private InstanceServices CreateServices(string instanceName)
 {
     var path = Path.Combine(indexPath, instanceName);
     var accessor = new LuceneAccesor(path);
     var indexer = new LuceneIndexer(accessor);
     var searcher = new LuceneLightweightSearcher(accessor);
     return new InstanceServices { indexer = indexer, searcher = searcher };
 }
示例#2
0
		public override void SetUp()
		{
			base.SetUp();

			accessor = new LuceneAccesor(new ThreadContext(), new DatabaseSection());
			indexer = new LuceneIndexer(accessor, new TextExtractor(new IndexableDefinitionExtractor(definitions)));
			root = CreateOneItem<PersistableItem1>(1, "The Root Page", null);
			indexer.Clear();
		}
示例#3
0
		public override void SetUp()
		{
			base.SetUp();

			var definitions = TestSupport.SetupDefinitions(typeof(PersistableItem1), typeof(PersistableItem2), typeof(PersistablePart1));

			accessor = new LuceneAccesor(new ThreadContext(), new DatabaseSection());
			indexer = new LuceneIndexer(accessor, new TextExtractor(new IndexableDefinitionExtractor(definitions)));
			searcher = new LuceneSearcher(accessor, persister);
			worker = new AsyncWorker();
			asyncIndexer = new AsyncIndexer(indexer, persister, worker, Rhino.Mocks.MockRepository.GenerateStub<IErrorNotifier>(), new DatabaseSection());
			tracker = new ContentChangeTracker(asyncIndexer, persister, new N2.Plugin.ConnectionMonitor(), new DatabaseSection());

			accessor.LockTimeout = 1L;
			indexer.Clear();
			root = CreateOneItem<PersistableItem1>(1, "The Root Page", null);
		}