Why is my Lucene index getting locked?
- by Andrew Bullock
I had an issue with my search not return the results I expect.
I tried to run Luke on my index, but it said it was locked and I needed to Force Unlock it (I'm not a Jedi/Sith though)
I tried to delete the index folder and run my recreate-indicies application but the folder was locked. Using unlocker I've found that there are about 100 entries of w3wp.exe (same PID, different Handle) with a lock on the index.
Whats going on?
I'm doing this in my NHibernate configuration:
c.SetListener(ListenerType.PostUpdate, new FullTextIndexEventListener());
c.SetListener(ListenerType.PostInsert, new FullTextIndexEventListener());
c.SetListener(ListenerType.PostDelete, new FullTextIndexEventListener());
And here is the only place i query the index:
var fullTextSession = NHibernate.Search.Search.CreateFullTextSession(this.unitOfWork.Session);
var fullTextQuery = fullTextSession.CreateFullTextQuery(query, typeof (Person));
fullTextQuery.SetMaxResults(100);
return fullTextQuery.List<Person>();
Whats going on? What am i doing wrong?
Thanks