On May 29, 2008, at 5:57 PM, Mark Miller wrote:
Paul J. Lucas wrote:
Are you saying that using multiple IndexSearchers will definitely
cause the problem I am experiencing and so the suggestion that
using a single IndexSearcher for optimaztion only is wrong?
Will it definitely cause your problem? I wouldn't say that. But it
could.
Then, to me, it seems like a bug in Lucene. Code as straight-forward
as mine is should not be able to get Lucene into a bad state.
Also, yes I would say its wrong that you should only do it as an
optimization - unless you really know what you are doing.
Constructing a Searcher is slow (actually the underlying Reader),
and so you don't want to do it every time someone searches...it will
really slow you down.
My understanding of an IndexSearcher is that, once opened, it only
"sees" an index as a snapshot in time at the time it was opened and,
for subsequent deletes or adds to be "seen" by an IndexSearcher, you
have to create a new one.
If that's true, then sharing an IndexSearcher for me wouldn't be a
great performance increase since the directory structure changes
frequently and so the index is modified frequently and so I'd be
creating and opening a new IndexSearcher to replace the old (now
"stale") shared one anyway.
It also complicates my code by a lot. I actually had it this way once
(and it did nothing to solve my current problem). I had to derive
from IndexSearcher, override close() so it would truly close only when
the IndexSearcher becomes "stale" because the index changed.
Also, if you get a ton of concurrent searches ...
But I never do. My server is only ever accessed by exactly one (!)
client. Ever. The lone client may issue several concurrent requests,
but they do not rise to the level of a "ton".
The only time I usually see this error, I also see too many files
open first. Are you sure you don't have another exception as well?
Yes I'm sure there is no other exception.
Ok...normally I recall them going together but that may not always
be the case. Basically, I can't guarantee you this is your
problem...but I do know its very possible. Some others on the list
may have other ideas too.
I can only hope.
- Paul
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]