I'm less familiar with IndexSearcher, but I agree this issue (LUCENE-1203 is the original one) has been open for quite a while and there seems to be some demand to set an IndexReader on an existing IndexSearcher.
However, I think Yonik spells out the concerns in LUCENE-1203: each instance of IndexReader, and each instance of IndexSearcher, are assumed to search an unchanging "point in time" snapshot of the index and so in order to get a changed IndexSearcher you need to 1) reopen the IndexReader (potentially high cost operation), and 2) wrap that new IndexReader into an IndexSearcher (a very low cost operation).
Maybe you could change your code below to either rebind a new searcher every time a new IndexReader is reopened, or, you could make a separate class that has a getSearcher() method that the client code must invoke every time it wants to do a search?
Mike Anthony Urso wrote:
Can people-in-the-know comment and/or take action on LUCENE-1315? If it is unpalateable, let me know the right way to do something along these lines: reader = IndexReader.open(directory); searcher = new IndexSearcher(reader); LocateRegistry.createRegistry(port); Naming.rebind(name, new RemoteSearchable(searcher)); while (true) { IndexReader oldReader = reader; reader = oldReader.reopen(); searcher.setIndexReader(reader); oldReader.close(); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]