views:

70

answers:

2

Hi,

I have an Asp.Net MVC app and I am looking into implementing a search engine that will search for individuals. I would like to use Nhibernate Search & Lucene.Net as this will keep the index in sync when an individual is inserted or updated, resulting in changes being visible when a user runs a search.

The issue I have is what if multiple users are updating the index at the same time, how does Nhibernate Search handle this? Is Lucene responsible for locking?

Any help will be greatly appreciated.

Regards

Spam

+1  A: 

I believe this post may answer your question:

Does Lucene.Net manage multiple threads accessing the same index, one indexing while the other is searching?

Thanks,

Hal

Hal
A: 

Lucene.NET will handle locking for you, however running several Applications might have colliding locks since the all instances store the lockfile in the temp-folder.

This was fixed in Lucene 2.3 or something, where they started to store the lockfile in the basedir (where all index-files resides), by default.

Although, I think an index-write during a search or write from another thread/process will throw an exception, therefor it would be wise to handle that accordingly (for instance, queue an update for that entity).

jishi