public async Task CannotWriteTwoLuceneIndexesOnSameStore() { var docs = CreateIpsumDocs(1); await _indexer.WriteToIndex(docs, true).ConfigureAwait(false); var store = new SecureStore(_store); using (var indexer2 = new LuceneIndex(store, "testindexer", "basePath", null)) { Assert.ThrowsAsync <LockObtainFailedException>(() => { return(indexer2.WriteToIndex(docs)); }); } }
public void RecreatingWriterDoesNotRefreshIndex() { LeoTrace.WriteLine = Console.WriteLine; _indexer.WriteToIndex(CreateIpsumDocs(3), true).Wait(); _indexer.Dispose(); _indexer = new LuceneIndex(new SecureStore(_store), "testindexer", "basePath", null); _indexer.WriteToIndex(CreateIpsumDocs(3), true).Wait(); _indexer.Dispose(); _indexer = new LuceneIndex(new SecureStore(_store), "testindexer", "basePath", null); var number = _indexer.SearchDocuments(s => s.Search(new MatchAllDocsQuery(), int.MaxValue)).Count(); Assert.AreEqual(6, number); }