This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I'm trying to use LightSpeed's built-in Lucene FTS with SQLite. Using a UnitOfWork to insert records works fine, but when I have a LuceneSearchEngine defined in the datacontext I get an exception: The process cannot access the file '[* SQLite File *]' because it is being used by another process. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.File.Delete(String path) at TypeMock.Interceptors.FileInterceptor.Delete(String path) at Lucene.Net.Store.FSDirectory.Create() at Lucene.Net.Store.FSDirectory.Init(FileInfo path, Boolean create) at Lucene.Net.Store.FSDirectory.GetDirectory(FileInfo file, Boolean create) at Lucene.Net.Store.FSDirectory.GetDirectory(String path, Boolean create) at Lucene.Net.Index.IndexWriter..ctor(String path, Analyzer a, Boolean create) at Mindscape.LightSpeed.Search.LuceneSearchEngine.() at Mindscape.LightSpeed.Search.LuceneSearchEngine.Add(IndexKey indexKey, String data) at Mindscape.LightSpeed.Search.SearchEngineBroker.Add(Entity entity) at ...() at Mindscape.LightSpeed.UnitOfWorkBase.() at Mindscape.LightSpeed.UnitOfWork..Commit() at Mindscape.LightSpeed.UnitOfWork.SaveChanges(Boolean reset) at Mindscape.LightSpeed.UnitOfWorkBase.SaveChanges() I'm using the System.Data.SQLite dll that's bundled with LS. Any ideas? Vikram |
|
|
Ah -- should've RTFM-ed the Lucene docs. The SearchEngineFileLocation cannot be the same folder as the one your SQLite (data) file is in, and it has to be an empty directory. Interesting. Anyone have any advice or best practises for where the Lucene index should be stored? SQLite FTS stores the index in the data file, which would be easier logistically, especially if the user is going to be creating and deleting lots of data files. Mindscape guys -- would be lovely if we had a SQLiteFTSEngine option built into LightSpeed. Vikram |
|
|
Hi Vikram, Thanks for posting and I'm glad to hear you sorted the issue out :-) There's no particular best practice for Lucense index storage, it will depend on your application. Generally I always just have an 'index' folder with the application data and use that. As an aside, you technically can share a directory with Lucene but we don't allow it as Lucene create a lot of files prior to optimizing the index and and generally having it kept by itself makes it easier to manage (also helpful with tools like Luke for Lucene which you point at a directory -- the impression I've always had is that most people keep Lucene in a directory by itself). Regarding the SQLite FTS provider, that's a cool idea. Technically the LightSpeed Seach API is fully pluggable so you could write this yourself (and we have had customers building their own providers in the past). Perhaps post the idea on the feature request board and see if others are keen? If there's enough interest we'd certainly look at bolting it in ourselves. We started with Lucene because 1. It's awesome and 2. It's not provider specific so all database types could support it. Here's the feature request site: http://www.mindscapehq.com/thinktank/product/9 I hope that helps! John-Daniel Trask |
|