On 11/07/2005, at 9:15 AM, Chris Hostetter wrote:
: Nathan's point about pooling Searchers is something that we also
: addressed by a LRU cache mechanism. In testing we also found that
Generally speaking, you only ever need one active Searcher, which
all of
your threads should be able to use. (Of course, Nathan says that
in his
code base, doing this causes his JVM to freeze up, but I've never seen
this myself).
Thanks for your response Chris. Do you think we are going down a
deadly path by having "many smaller" IndexSearchers open rather than
"one very large one"?
As I understand it, the general rule is: if you call
IndexReader.open, you
better call .close() on that reader. If you construct and
IndexSearcher
using a Directory or a path, then calling .close() on the searcher
will
take care of closing the reader -- but if your code look like this...
Searcher s = new IndexSearcher(IndexReader.open(foo))
...then you are screwed, because nothing will ever close that
reader and
free it's resources.
That was my initial thought when Nathan outlined is issue. I've seen
that happen before myself.
Paul