lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Steffensen <>
Subject Re: question about SearcherManager in version 3.5.0
Date Sat, 07 Jan 2012 17:15:42 GMT
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

On Fri, Jan 6, 2012 at 10:44 PM, chenhan <> 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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message