Sorry, just realised my mistake. I should read the docs more carefully. IndexReader.reopen() does not reopen the existing IndexReader, but returns a new one.
Phil On Mon, Sep 14, 2009 at 3:20 PM, Phil Whelan <phil...@gmail.com> wrote: > Hi, > > I'm not sure why my IndexReader.reopen() call is not working. > > The latest results are not coming back, meaning the reader / searcher > has not being re-opened for the new Documents that have been added. > > IndexReader openReader = searcher.getIndexReader(); > searcher.close(); > openReader.reopen(); > searcher = new IndexSearcher(openReader); > > If I close and open the reader, I do see the updated results, but I > thought reopen was more efficient, so I really like to use that. > > IndexReader openReader = searcher.getIndexReader(); > searcher.close(); > openReader.close(); > openReader = IndexReader.open(new NIOFSDirectory(indexPath), true); > searcher = new IndexSearcher(openReader); > > Any advice? (using lucene 2.9rc4) > > Thanks, > Phil > -- Mobile: +1 778-233-4935 Website: http://philw.co.uk Skype: philwhelan76 Twitter: philwhln Email : phil...@gmail.com iChat: philw...@mac.com --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org