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 <[email protected]> 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 <[email protected]>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> 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]

Reply via email to