jafarim <[EMAIL PROTECTED]> wrote on 14/04/2007 01:16:49:

> hi list,
> I am using a ParallelMultiSearcher in order to search a number of
indices.
> As the rate of input to the index is very high I have to check
> indexSearcher.isCurrent quite often and have to reopen the index. There
are
> however to issues:
>
> - In order to have a current version of a searcher, do I have to get a
new
> instance of the underlying fsDirectory (on which I have built the
searcher)
> too?

Assuming the PMS is created over IndexSearchers, would something like this
do:

  Searchable srchbls[] = pms.getSearchables();
  for (i ... ) {
    IndexSearcher is = (IndexSearcher) srchbls[i];
    if (!is.getIndexReader().isCurrent()) {
      Directory d = is.getIndexReader().directory();
      is.close(); // note: must make sure pms is not in use! do not call
pms.close()!
      srchbles[i] = new IndexSearcher(d);
    }
  }

> - My only choice now seems to be reopening the corresponding Searcher and
> then creating another MultiSearcher object from the Searchers vector. Is
> there any way to reopen only one of the underlying Searchers in
> MultiSearcher without destroying the MultiSearcher object?

No such option, because the PMS does some initialization with the searchers
provided at construction and would not re-init. But PMS is a just a
wrapper, I don't think this would be a problem. Once the array srchbls is
obtained above, just reopen non-current searchers in that array (updating
the array as well) and use the same array to create a new PMS. Do you
anticipate (or experienced) any problems this way?

>
> --jaf


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to