The Lucene documentation states that the fastest way to use one instance of IndexWriter and IndexSearcher is in an application.
At the moment, all the time, the static instance of IndexWriter open, and the static instance of IndexSearcher , which always remains open, but is restored when, if IndexWriter performs any CRUD operations on the index, I applied the Dispose method to my index management class, which closes as IndexWriter . and IndexSearcher when the application ends (however it is a web application, so it is potentially months of work without a call).
Does that sound like a smart way to do things? And also with the use of static instances there are problems with multithreaded ..? That is, Do I have to lock my author and search engine when using?
source share