These blog posts may also help describe SearcherManager and NRTManager: http://blog.mikemccandless.com/2011/09/lucenes-searchermanager-simplifies.html http://blog.mikemccandless.com/2011/11/near-real-time-readers-with-lucenes.html
Mike McCandless http://blog.mikemccandless.com On Sat, Jan 7, 2012 at 12:15 PM, Greg Steffensen <greg.steffen...@gmail.com> wrote: > You only need one SearcherManager instance for every IndexWriter you have > open (basically, one for your application). The SearcherManager class is > thread-safe- that's the point- so all threads can retrieve their > IndexSearchers from it without any additional synchronization in your code. > So you can use it as a singleton if you'd like (although singletons in > general are often a bad idea, for reasons that have nothing to do with > Lucene). > > On Fri, Jan 6, 2012 at 10:44 PM, chenhan <chenhan...@gmail.com> wrote: > >> hi, >> i'm writing a normal web-search application with lucene 3.5.0. in version >> 3.5.0 lucene provides SearcherManager to manage multithreaded searching. >> but i don't know how to use this class. should i use it as singleton, or >> should i initialize an instance for each searching? >> >> expect for your reply! thank you! >> >> -- >> chenhan >> Sent with Sparrow >> --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org