Updating Lucene index from two different threads in a web application

I have a .net web application that uses Lucene.net for the company search functionality. When registered users add a new company, it is saved in the database and also indexed in the Lucene-based company search index in real time.

When you add a company to the Lucene index, how do I handle the case of two or more registered users at the same time publishing a new company? Also will both of these companies be indexed without file locks, timeout locks, etc.?

Understand if I could help with the code.



source to share

1 answer

By default Lucene.Net has built-in index locking using a text file. However, if the default blocking mode isn't good enough, there are others you can use (which are included in the Lucene.Net source code).



All Articles