You'll have to call .commit() from the IndexWriter to make the changes externally visible.
The call IndexReader.reopen to get a reader seeing the committed changes; the reopen will be efficient (only open "new" segments vs the old reader). It's still best to use near-real-time reader when possible (ie, open the IndexReader from the IndexWriter), but it sounds like in your case this is not possible since writer and reader on different JVMs/machines across a network. Mike McCandless http://blog.mikemccandless.com On Sun, Oct 16, 2011 at 10:32 PM, Denis Bazhenov <dot...@gmail.com> wrote: > We have situation when lucene index is replicated over network. And on that > machine reader reopen doesn't make new documents visible to a search. > > As far as I know IndexReader.reopen() call does work only if changes are > applied using the linked IndexWriter. My question is: how can I implement > efficient index reopen (only new segments should be read) when index is > changed externally? > --- > Denis Bazhenov <dot...@gmail.com> > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org