lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Whelan <phil...@gmail.com>
Subject Problems with IndexReader.reopen()
Date Mon, 14 Sep 2009 22:20:07 GMT
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

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message