lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: simple question about index reader
Date Thu, 13 Feb 2014 15:18:17 GMT
The reader holds all the underlying files still open, and relies on
the filesystem to "protect" still-open files that are deleted.

Windows does this by refusing to allow deletion.  Unix does it by
keeping the file bytes available on disk but removing the directory
entry ("delete on last close").

Mike McCandless

On Thu, Feb 13, 2014 at 10:14 AM, Yonghui Zhao <> wrote:
> Hi,
> I am new to lucene and I get a simple question about index reader.
> If I open a DirectoryReader say reader1 based on a disk directory, then the
> lucene index directory is changed, to get new result I need get a new
> DirectoryReader.
> Suppose reader1 will get the result before the change forever.
> I am wondering how lucene can guarantee reader1's result is not changed.
> If I delete all docs from the folder after reader1 is opened,  after
> optimize the directory should be empty now, how can reader1 still get old
> result?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message